у меня вопросик как припаять этот яваскрипт в мой dowloads.php ?
вот javascript <div id="dl" align="center">
Если Вы видите это сообщение, Вам нужно включить использование JavaScript
</div>
<script language="Javascript">
x597=30;
function countdown()
{
if ((0 <= 100) || (0 > 0))
{
x597--;
if(x597 == 0)
{
document.getElementById("dl").innerHTML = '<a href="http://www.wars.lv/downloads.php?view=283">Скачать</a>';
}
if(x597 > 0)
{
document.getElementById("dl").innerHTML = 'Пожалуйста подождите <b>'+x597+'</b> секунд..';
setTimeout('countdown()',1000);
}
}
}
countdown();
</script>
и скрипт downloads.php <?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2005 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+-----------------------------------------------------
| PHP-Fusion 6 DownloadFront Management System
+-----------------------------------------------------
| Copyright © 2005 Sokolov Konstantin
| http://fusion.byweb.ru
| GNU General Public License visit http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
/*не показывает прямую ссылку
if (isset($download_id) && isNum($download_id)) {
$res = 0;
if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".$db_prefix."downloads WHERE download_id='$download_id'"))) {
$cdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='".$data['download_cat']."'"));
if (checkgroup($cdata['download_cat_access'])) {
$res = 1;
$result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$download_id'");
if (!file_exists($data['download_url'])) {
header ("HTTP/1.0 403 Forbidden");
exit;
}
header("HTTP/1.1 200 OK");
header("Content-Disposition: attachment; filename=" . basename($data['download_url']));
header("Content-Length: ".filesize($data['download_url']));
header("Content-type: application/octet-stream");
print file_get_contents($data['download_url']);
exit;
}
}
if ($res == 0) redirect("downloads.php");
}*/
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."downloads.php";
if (isset($download_id) && !isNum($download_id)) fallback("index.php");
if (!isset($cat_id)) {
opentable($locale['400']);
$result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE ".groupaccess('download_cat_access')." ORDER BY download_cat_name");
$rows = dbrows($result);
if ($rows != 0) {
$counter = 0; $columns = 2;
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";
while ($data = dbarray($result)) {
if ($counter != 0 && ($counter % $columns == 0)) echo "</tr>\n<tr>\n";
$num = dbcount("(download_cat)", "downloads", "download_cat='".$data['download_cat_id']."'");
echo "<td align='left' valign='top' width='50%' class='tbl'><img src='".BASEDIR."zfolder.png'> <a href='".FUSION_SELF."?cat_id=".$data['download_cat_id']."'>".$data['download_cat_name']."<
/a> <span class='small2'>($num)</span>";
if ($data['download_cat_description'] != "") echo "<br>\n<span class='small'>".$data['download_cat_description']."</span>";
echo "</td>\n" ;
$counter++;
}
echo "</tr>\n</table>\n";
} else {
echo "<center><br>\n".$locale['430']."<br><br>\n</center>\n";
}
echo "<br><center><div class=poll > Если у вас есть интересгые файлы, которых нет на сайте, вы можете их добавить используя пункт 'Добавить файл' в меню навигации. Он доступен только для зарегистрированных пользователей!</u></center>\n";
closetable();
} else {
$res = 0;
if (!isNum($cat_id)) fallback(FUSION_SELF);
$result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='$cat_id'");
if (dbrows($result) != 0) {
$cdata = dbarray($result);
if (checkgroup($cdata['download_cat_access'])) {
$res = 1;
opentable($locale['400'].": ".$cdata['download_cat_name']);
$rows = dbcount("(*)", "downloads", "download_cat='$cat_id'");
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
if ($rows != 0) {
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_cat='$cat_id' ORDER BY ".$cdata['download_cat_sorting']." LIMIT $rowstart,10");
$numrows = dbrows($result); $i = 1;
while ($data = dbarray($result)) {
if ($data['download_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
$new = " <span class='small'>".$locale['410']."</span>";
} else {
$new = "";
}
$tot_votes = dbresult(dbquery("SELECT COUNT(rating_item_id) FROM ".$db_prefix."ratings WHERE rating_item_id='".$data['download_id']."' AND rating_type='F'"),0);
$sum_vote = dbresult(dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_item_id='".$data['download_id']."' AND rating_type='F'"),0);
if($tot_votes){
$pc_rating = sprintf("%.1f", $sum_vote/$tot_votes);
$pct_rating = "<span title='Оценка программы: $pc_rating/$tot_votes'><img src=".THEME."images/rating/$pc_rating.gif></span>";
}else {$pct_rating = "<span title='Оценка программы: 0.0/0'><img src=".THEME."images/rating/0.0.gif></span>";}
$comments = dbcount("(comment_id)", "comments", "comment_type='F' AND comment_item_id='".$data['download_id']."'");
echo "<table width='100%' cellpadding='0' cellspacing='1' class='tbl-border'>\n";
echo "<tr>\n<td colspan='4' class='forum-caption'>
<a href='".FUSION_SELF."?view=".$data['download_id']."' ><b>".$data['download_title']."</b></a> $new</td>\n</tr>\n";
if ($data['download_description'] != "")
echo "<tr>\n<td colspan='4' class='tbl1'>".parseubb(nl2br($data['download_description']))."</td>\n</tr>\n";
$result2 = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='".$data['download_user']."'");
$data2 = dbarray($result2);
echo "<tr>\n<td width='25%' class='tbl2'><b>".$locale['411']."</b> <a href='profile.php?lookup=".$data['download_user']."' target='_self'>".$data2['user_name']."</td>\n<td width='20%' class='tbl1'><b>".$locale['D412']."</b> ".$data['download_os']."</td>\n";
//echo "<tr>\n<td width='20%' class='tbl2'><b>".$locale['411']." ".$data1['download_license']." </td>\n<td width='20%' class='tbl1'><b>".$locale['412']."</b> ".$data['download_os']."</td>\n";
echo "<td width='20%' class='tbl2'><b>".$locale['413']."</b> ".$data['download_version']."</td>\n<td width='40%' class='tbl1'><b>".$locale['414']."</b> ".showdate("%d.%m.%y", $data['download_datestamp'])."</td></tr>\n";
echo "<tr><td width='20%' class='tbl1'><b>Комментарии:</b> $comments</td>\n<td width='20%' class='tbl2'><b>Размер:</b> ".$data['download_filesize']."</td>\n";
echo "<td width='20%' class='tbl1'><b>".$locale['415']."</b> ".$data['download_count']."</td>\n<td width='40%' class='tbl2'>Рейтинг: $pct_rating</td>\n
</tr>\n";
echo "</table>\n";
if ($i != $numrows) {
echo "<div align='center'><img src='".THEME."images/blank.gif' alt='' height='15' width='1'></div>\n"; $i++; }
}
closetable();
if ($rows > 10) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,10,$rows,7,FUSION_SELF."?cat_id=$cat_id&")."\n</div>
2;n";
} else {
echo $locale['431']."\n";
closetable();
}
}
}
if ($res == 0) redirect(FUSION_SELF);
}
if (isset($view)) {
if (!isNum($view)) fallback(FUSION_SELF);
if (!$rowstart) {
$rowstart = 0;
$result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_id='$view'");
if (dbrows($result) != '') {
$data1 = dbarray($result);
$description = parseubb(nl2br($data1['download_description']));
$tot_votes = dbresult(dbquery("SELECT COUNT(rating_item_id) FROM ".$db_prefix."ratings WHERE rating_item_id='".$data1['download_id']."' AND rating_type='F'"),0);
$sum_vote = dbresult(dbquery("SELECT SUM(rating_vote) FROM ".$db_prefix."ratings WHERE rating_item_id='".$data1['download_id']."' AND rating_type='F'"),0);
if($tot_votes){
$pc_rating = sprintf("%.1f", $sum_vote/$tot_votes);
$pct_rating = "<span title='Оценка программы: $pc_rating/$tot_votes'><img src=".THEME."images/rating/$pc_rating.gif></span>";
}else {$pct_rating = "<span title='Оценка программы: 0.0/0'><img src=".THEME."images/rating/0.0.gif></span>";}
echo"<table border=0 width=100% cellspacing=0 cellpadding=5><tr>
<td width=70%><h2><img src='".BASEDIR."recycle.png' border=0 width=36 height=17> <font color='#8B864E'>".$data1['download_title']."</font></h2></td>
<td align=center width=30%><b>Рейтинг: $pct_rating<br>";
#if (iMEMBER) {
$max = $data1['exp'];
$posts = $userdata['user_posts'];
$comment = dbcount("(comment_id)", "comments", "comment_name='".$userdata['user_id']."'");
$shoutbox = dbcount("(shout_id)", "shoutbox", "shout_name='".$userdata['user_id']."'");
$rating = dbcount("(rating_id)", "ratings", "rating_user='".$userdata['user_id']."'");
$sum = ($posts+$comment+$shoutbox+$rating);
if ($sum >= $max) {
if (isset($download_id)) {
#$res = 0;
if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".$db_prefix."downloads WHERE download_id='$view'"))) {
$cdata = dbarray(dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='$view'"));
#if (checkgroup($cdata['download_cat_access'])) {
#$res = 1;
$result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$view'");
redirect($data['download_url']);
#}
}
# if ($res == 0) redirect("downloads.php");
}
echo"<div class=button align=center><a href='$PHP_SELF?view=$view&download_id=$view' target='_blank' class=shoutboxname>ЗАКАЧАТЬ</a></div>";
}
else {
echo"<div class=button align=center title='Вам нужно набрать достаточное количество Exp'>У ВАС: $sum Exp</div>Необходимо: $max Exp";
}
}
else {echo"<div class=textbox align=center title='ВЫ НЕАВТОРИЗОВАННЫ'><font color='#00BFFF'>Закачка будет доступна после авторизации <img src=".BASEDIR."lock.png></FONT></div><a href=".BASEDIR."register.php target=_blank>Регистрация</a>";}
if (isset($download_url)) {
echo"<br>Access Denied";
}
echo"</td></tr>
<tr><td colspan='2'>
<div align=left class=tbl2>Дата добавления: ".showdate("<i>%d.%m.%Y</i> · Время добавления: <i>%H:%M</i>", $data1['download_datestamp'])." · Размер: ".$data1['download_filesize']." · Закачек: ".$data1['download_count']."";
if (iADMIN){echo" · <a href='".ADMIN."downloads.php?aid=1aaba44f176c64b6&step=edit&download_id=$view' target='_blank'>ПРАВИТЬ</a>";}
echo"</div>
<br>$description</td><td></td></tr>
<tr>";
$result2 = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id='".$data1['download_user']."'");
$data2 = dbarray($result2);
echo "<tr>\n<td width='20%' class='tbl2'><b>".$locale['411']."</b> <a href='profile.php?lookup=".$data1['download_user']."' target='_self'>".$data2['user_name']."</td>\n<td width='20%' class='tbl2'><b>".$locale['D412']."</b> ".$data1['download_os']."</td>\n";
echo "</td>\n</tr>\n<tr><td class='tbl1' colspan=2><a href='/forum'>Обсудить на форуме</a></td></tr>";
echo"</div></td><td></td></tr></table>";
//include INCLUDES."downloadfront_ratings_include.php";
include INCLUDES."comments_include.php";
require_once INCLUDES."ratings_include.php";
showcomments("F","downloads","download_id",$view,FUSION_SELF."?view=$view",$xxx);
showratings("F",$view,FUSION_SELF."?view=$view");
}
else
echo"<div class=button align=center>В данной категории нет файлов. Возможно он был перенесен в другую категорию.</div>";
}
#}
require_once "side_right.php";
require_once "footer.php";
?>
|
|