Цитата:
можно просто таблички нужные тебе в базе выбери и все
не можешь дать код для стандартного search.php изменённый?
А то я добавил новую опцию "искать везде", но условие не знаю как поставить, т.е. из базы выбрать таблички.
можно просто таблички нужные тебе в базе выбери и все
Как сделать ники админов красным, модеров зеленым?
И что за бред с .gif, почему нельзя использовать как аватару? Неужели это нельзя фиксануть?
[/q]
где именно во всей cms или только на форуме ???[q]
Бред, у меня jpeg грузятся а гиф нет... в чем может быть причина? размер я увеличил до 200 kb. Гружу любую гифку не идёт...jpeg всё ок...
updated:
Профиль ведет себя странно! Уже вроде закидывается всё...причём стоит сайт на платном хосте...глюки =)
<?php
require_once "maincore.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'><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";
}
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,15");
$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'>".nl2br(stripslashes($data['download_description']))."</td>\n</tr>\n";
echo "<tr>\n<td width='20%' class='tbl2'><b>".$locale['411']."</b> ".$data['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 > 15) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,15,$rows,3,FUSION_SELF."?cat_id=$cat_id&")."\n</div>\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>".$data1['download_title']."</h2></td>
<td align=center width=30%><b>Рейтинг: $pct_rating<br>";
if (iMEMBER) {
$max = "5";
$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>У ВАС: $sum Exp</div>Необходимо: $max Exp";
}
}
else {echo"<div class=button align=center title='Закачка будет доступна после авторизации'>ВЫ НЕАВТОРИЗОВАННЫ</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 (iAMDIN){echo" · <a href='".ADMIN."downloads.php?step=edit&download_id=$view' target='_blank'>EdiT</a>";}
echo"</div>
<br>$description</td><td></td></tr>
<tr><td colspan='2'><div align=left class=tbl2>".$locale['411']." ".$data1['download_license']." · ".$locale['412']." ".$data1['download_os']." · ".$locale['413']. " ".$data1['download_version']." ";
echo"</div></td><td></td></tr></table>";
include INCLUDES."downloadfront_ratings_include.php";
include INCLUDES."comments_include.php";
showcomments("F","downloads","download_id",$view,FUSION_SELF."?view=$view");
showratings("F",$view,FUSION_SELF."?view=$view");
}
else
echo"В данной категории нет файлов. Возможно он был перенесен в другую категорию.";
}
}
echo"<div align=right><a href=http://fusion.byweb.ru target=_blank>DownloadFront</a> v.1.1 Lite | Copyright by <a href=mailto:webmaster@byweb.ru>DriveR</a> © 2005</div>";
require_once "side_right.php";
require_once "footer.php";
?>
level: Суперадминистратор и Администратор
color: green
---
level: Модератор
color: green
---
v.6.00.307
---
у остальных пользователей так же останется тот цвет который и был до мода.
если ты обращаешься ко мне скажи где я добавил лишнее?
первый closeside оставь и последний, всё между ними убери.... вот в downloads.php (выше я спрашивал) там надо ведь как-то условия убрать if (iMEMBER), да? А как будет гость? Или это не сработает?
if (iMEMBER)
$max = "0";
$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>У ВАС: $sum Exp</div>Необходимо: $max Exp";
}
if (isset($download_url)) {
echo"<br>Access Denied";
}
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");
}
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");
}
Да, вообще, сколько там максимум юзеров в строке "Кто в он-лайн" появиться может?
$result = dbquery(
"SELECT ton.*, user_id,user_name FROM ".$db_prefix."online ton
LEFT JOIN ".$db_prefix."users tu ON ton.online_user=tu.user_id
WHERE online_user!='0'"
);
$members = dbrows($result);
if ($members != 0) {
$i = 1;
echo $locale['012'];
while($data = dbarray($result)) {
echo "<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'>".$data['user_name']."</a>";
if ($i != $members) echo ", ";
$i++;
}
echo "<br>\n";
} else {
echo $locale['013']."<br>\n";
}
Можно ли сделать строчку показать всех, например?
openside($locale['010']);
if ($settings['maintenance'] != "1") {
$cond = ($userdata['user_level'] != 0 ? "'".$userdata['user_id']."'" : "'0' AND online_ip='".USER_IP."'");
$result = dbquery("SELECT * FROM ".$db_prefix."online WHERE online_user=".$cond."");
if (dbrows($result) != 0) {
$result = dbquery("UPDATE ".$db_prefix."online SET online_lastactive='".time()."' WHERE online_user=".$cond."");
} else {
$name = ($userdata['user_level'] != 0 ? $userdata['user_id'] : "0");
$result = dbquery("INSERT INTO ".$db_prefix."online (online_user, online_ip, online_lastactive) VALUES ('$name', '".USER_IP."', '".time()."')");
}
$result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_lastactive<".(time()-3600).""); //вместо time()-60) поставил time()-3600)
$result = dbquery(
"SELECT ton.*, user_id,user_name FROM ".$db_prefix."online ton
LEFT JOIN ".$db_prefix."users tu ON ton.online_user=tu.user_id
WHERE online_user!='0'"
);
$members = dbrows($result);
if ($members != 0) {
$i = 1;
while($data = dbarray($result)) {
echo "<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' class='side'>".$data['user_name']."</a><br>";
if ($i != $members) echo ", ";
$i++;
}
echo "<br>\n";
} else {
echo $locale['013']."<br>\n";
}
}
closeside();
<?php
require_once "../maincore.php";
include BASEDIR."subheader.php";
include ADMIN."navigation.php";
include LOCALE.LOCALESET."admin/wioa.php";
if (!iADMIN) { header("Location:../index.php"); exit; }
opentable($locale['WIOA_000']);
$serverdate = date("Y.m.d, h:i");
echo "<br><p align=center><br>".$locale['WIOA_001']." - <B>$serverdate</B></p><br>
<br><table width='90%' border='0' cellspacing='0' cellpadding='2' align='center'><tr>
<td style='border: 1px solid ".$body_text.";' align='center'><b>".$locale['WIOA_002']."</b></td>
<td style='border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text."; border-top: 1px solid ".$body_text.";' align='center'><b>".$locale['WIOA_003']."</b></td>
<td style='border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text."; border-top: 1px solid ".$body_text.";' align='center'><b>".$locale['WIOA_004']."</b></td>
<td style='border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text."; border-top: 1px solid ".$body_text.";' align='center'><b>".$locale['WIOA_005']."</b></td>
<td style='border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text."; border-top: 1px solid ".$body_text.";' align='center'><b>".$locale['WIOA_006']."</b></td>
<td style='border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text."; border-top: 1px solid ".$body_text.";' align='center'><b>".$locale['WIOA_007']."</b></td></tr>";
$result=dbquery("SELECT * FROM ".$db_prefix."online ORDER BY online_ip");
while ($data=dbarray($result)) {
if($data['online_user'] == 0) {
$uname = "<img src='".BASEDIR."images/red_dot.gif' align='absmiddle' border='0' alt='".$locale['WIOA_008']."'> ".$locale['WIOA_008']."";
} else {
$result2 = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_id=".$data['online_user']."");
$data3 = dbarray($result2);
$uname = "<img src='".BASEDIR."images/green_dot.gif' align='absmiddle' border='0' alt='{$data3['user_name']}'> <b>".$data3['user_name']."</b>";
}
$host = gethostbyaddr ($data['online_ip']);
$array = explode(".", $host);
$country = $array[sizeof($array)-1];
$country = strtoupper($country);
if (is_numeric($host)) {
$country = $locale['WIOA_009'];
} else {
$country = $locale['WIOA_010'];
}
// я добавил
function get_ip()
{
if ($ip = getenv("HTTP_CLIENT_IP")) return $ip;
if ($ip = getenv("HTTP_X_FORWARDED_FOR"))
{
if ($ip == '' || $ip == "unknown")
{
$ip = getenv("REMOTE_ADDR");
}
return $ip;
}
if ($ip = getenv("REMOTE_ADDR")) return $ip;
}
$ip=get_ip();
//закончил добавлять
//вместо .$data['online_wew_ip']. поставил $ip
echo "
<tr>
<td style='border-left: 1px solid ".$body_text."; border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text.";'>$uname</td>
<td style='border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text.";' align='center'>".$data['online_ip']."</td>
<td style='border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text.";' align='center'> ".$ip."</td>
<td style='font-size: 9px; border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text.";' align='center'><a href='http://".$host."' target='_blank'>$host</a></td>
<td style='border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text.";' align='center' align='center'>$country</td>";
$unixtime = time() - ($data['online_lastactive']);
if($unixtime < 60){
$sec=$unixtime;
$min=0;
$hour=0;
} else if($unixtime < 3600){
$sec=$unixtime%60;
$hour=0;
$min_t = explode('.', number_format($unixtime/60,2));
$min=$min_t[0];
} else if($unixtime >= 216000){
$hour_t = explode('.',number_format($unixtime/216000,2));
$hour=$hour_t[0];
$sec=$unixtime%60;
$min_te = $unixtime%216000;
$min_t = explode('.',number_format($min_te/60,2));
$min=$min_t[0];
}
echo "<td style='border-bottom: 1px solid ".$body_text."; border-right: 1px solid ".$body_text.";' align='center'>".$min."м:".$sec."с</td>";
}
echo "</tr></table><br>";
$guest_online_count = dbrows(dbquery("SELECT * FROM ".$db_prefix."online where online_user=0"));
$member_online_count = dbrows(dbquery("SELECT * FROM ".$db_prefix."online where online_user=1"));
echo "<center><img src='".BASEDIR."images/group.gif' height='14' width='17'> ".$locale['WIOA_011']." <b>$guest_online_count</b> ".$locale['WIOA_012']." <b>$member_online_count</b> ".$locale['WIOA_013'].".</center><br><br>";
closetable();
?>
function showexp($exp_user,$exp_posts,$exp_type) {
if (iMEMBER) {
$posts = $exp_posts;
$comment = dbcount("(comment_id)", "comments", "comment_name='$exp_user'");
$shoutbox = dbcount("(shout_id)", "shoutbox", "shout_name='$exp_user'");
$rating = dbcount("(rating_id)", "ratings", "rating_user='$exp_user'");
$sum = ($posts+$comment+$shoutbox+$rating);
if ($sum <= "1") {$rang = "0";$level = "0";}
if ($sum >= "1") {$rang = "5";$level = "5";}
if ($sum >= "5") {$rang = "25";$level = "25";}
if ($sum >= "15") {$rang = "50";$level = "50";}
if ($sum >= "25") {$rang = "100";$level = "100";}
if ($sum >= "40") {$rang = "250";$level = "250";}
if ($sum >= "55") {$rang = "500";$level = "500";}
if ($sum >= "70") {$rang = "1000";$level = "1000";}
if ($sum >= "100") {$rang = "2000";$level = "2000";}
if ($sum >= "150") {$rang = "4000";$level = "4000";}
if ($sum >= "400") {$rang = "10000";$level = "10000";}
$poll_posts = $rang;
$opt_posts = ($poll_posts ? number_format(100 / $poll_posts * $sum) : 0);
//
if ($exp_type == "1") {
echo"<b>Рейтинг пользователя:</b>
<br>Звание: $level
<br>Проголосовал раз: <b>$rating</b>
<br>Комментариев: <b>$comment</b>
<br><b>Всего очков: $sum</b>";
}
if ($exp_type == "opt_posts") {
echo"$opt_posts";
}
if ($exp_type == "rang") {
echo"$rang";
}
if ($exp_type == "sum") {
echo"$sum";
}
if ($exp_type == "posts") {
echo"$posts";
}
if ($exp_type == "shoutbox") {
echo"$shoutbox";
}
if ($exp_type == "comment") {
echo"$comment";
}
if ($exp_type == "rating") {
echo"$rating";
}
if ($exp_type == "level") {
echo"$level";
}
}
}
<?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";
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'><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";
}
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,15");
$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'>".nl2br(stripslashes($data['download_description']))."</td>\n</tr>\n";
echo "<tr>\n<td width='20%' class='tbl2'><b>".$locale['411']."</b> ".$data['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 > 15) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,15,$rows,3,FUSION_SELF."?cat_id=$cat_id&")."\n</div>\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>".$data1['download_title']."</h2></td>
<td align=center width=30%><b>Рейтинг: $pct_rating<br>";
if (iMEMBER) {
$max = "5";
$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>У ВАС: $sum Exp</div>Необходимо: $max Exp";
}
}
else {echo"<div class=button align=center title='Закачка будет доступна после авторизации'>ВЫ НЕАВТОРИЗОВАННЫ</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 (iAMDIN){echo" · <a href='".ADMIN."downloads.php?step=edit&download_id=$view' target='_blank'>EdiT</a>";}
echo"</div>
<br>$description</td><td></td></tr>
<tr><td colspan='2'><div align=left class=tbl2>".$locale['411']." ".$data1['download_license']." · ".$locale['412']." ".$data1['download_os']." · ".$locale['413']. " ".$data1['download_version']." ";
echo"</div></td><td></td></tr></table>";
include INCLUDES."downloadfront_ratings_include.php";
include INCLUDES."comments_include.php";
showcomments("F","downloads","download_id",$view,FUSION_SELF."?view=$view");
showratings("F",$view,FUSION_SELF."?view=$view");
}
else
echo"В данной категории нет файлов. Возможно он был перенесен в другую категорию.";
}
}
echo"<div align=right><a href=http://fusion.byweb.ru target=_blank>DownloadFront</a> v.1.1 Lite | Copyright by <a href=mailto:webmaster@byweb.ru>DriveR</a> © 2005</div>";
require_once "side_right.php";
require_once "footer.php";
?>
Хочу спросить только одно - можно ли вставить на странице просмотра файла ссылку, ведущую на каталог, в котором этот файл расположен?
<a href='index.php'>Главная сайта</a> -> <a href='downloads.php'>Файловый архив</a> -> <a href='downloads.php?cat_id=номер_категории'>Название категории</a> -> Название файла
Предыдущая тема: SAPID - персональная CMS открытая для развития