Файл: forum/forum/inc/index.php
Строк: 37
<?
##########################################
## Автор PITBULL ##
## icq 647732 ##
## mail mobilas91@gmail.com ##
## запрещено торговать скриптом ##
##########################################
echo links.'Новые <a href="new_t">Темы</a> | <a href="new_p">Сообщения</a><br />Мои <a href="my_t">Темы</a> | <a href="my_p">Сообщения</a> | <a href="bookmarks_0">Закладки</a>
<dl><dt></dt></dl>'.div;
echo links.'<b>Форумы:</b>'.div;
$q = DB::run() -> query("SELECT * FROM `forum_f` ORDER BY pos ;");
while ($de = $q -> fetch()) {
echo ''.$de['name'].'<br>';
}
if($user['level']<5){$q=DB::run()->query("select * from `forum_f` WHERE `level`=? order by pos ;", array(0));
}else $q = DB::run()->query("select * from `forum_f` order by pos " );
while ($for = $q->fetch())
{
$f = $for['id'];
$f_name = $for['name'];
$num = DB::run()->querySingle("select count(*) from `forum_msg` WHERE f_id =? ;",array($f));
$kol = $db->sql_numrows($db->sql_query("select * from `forum_t` WHERE f_id = '$f';"));
$tem = DB::run()->queryFetch("select * from `forum_t` WHERE f_id = ? order by time desc limit 1;",array($f));
echo '<dl></dl>';
echo links;
if ($user['level']>=7) {
echo '<a href="admin_editf_'.$f.'"><img src="'.H.'img/p2.png" alt="*"/></a> <b><a href="razdel_'.$f.'">'.$f_name.'</a></b> ('.$kol.'/'.$num.') <a href="razdel_'.$f.'_end">>></a>';
} else{
echo '<img src="'.H.'img/p2.png" alt="*"/> <b><a href="razdel_'.$f.'">'.$f_name.'</a></b> ('.$kol.'/'.$num.') <a href="razdel_'.$f.'_end">>></a>';
}
echo div;
echo text;
if ($user['razd']==1){
$q1 = DB::run()->query('SELECT * from `forum_r` WHERE f_id = ? order by pos limit 10;',array($f));
while ($for = $q1->fetch())
{
echo '<img src="'.H.'img/004.png" alt="*"/> <a href="temes_'.$for['id'].'">'.$for['name'].'</a> ('.$db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `forum_t` WHERE `f_id` = '$f' AND `r_id` = '".$for['id']."'"),0).'/'.$db->sql_fetchfield($db->sql_query("SELECT COUNT(*) FROM `forum_msg` WHERE `f_id` = '$f' AND `r_id` = '".$for['id']."'"),0).')<br>';
}
echo div;
}
//echo'</br>';
$k = DB::run()->queryFetch('SELECT * from `forum_r` WHERE id = ?;',array($tem['r_id']));
echo 'Раздел: <a href="temes_'.$tem['r_id'].'">'.$k['name'].'</a><br />Тема: <a href="tema_'.$tem['id'].'_end">'.$tem['name'].'</a><br />';
$post = DB::run()->queryFetch("select * from `forum_msg` WHERE t_id = ? order by time desc limit 1;",array($tem['id']));
echo 'Сообщение: <a href="'.H.user_inf($post['user_id']).'">'.user($post['user_id']).'</a></br>';
echo '('.times($post['time']).')';
}
if ($user['level']>=7) {echo '<br /><br /><dl><dt></dt></dl>';echo '<a href="admin_addf"><b>Создать</b></a><br/>';
}
echo '<dl><dt></dt></dl>';
?>