Файл: soo/forum/inc/index.php
Строк: 32
<?
echo '<a href="/soo/'.$soo.'">Сообщество</a> | Новые <a href="new_t?soo='.$soo.'">Темы</a> | <a href="new_p?soo='.$soo.'">Сообщения</a><br />Мои <a href="my_t?soo='.$soo.'">Темы</a> | <a href="my_p?soo='.$soo.'">Сообщения</a> | <a href="/forum/bookmarks_0">Закладки</a>
<br /><dl><dt></dt></dl>';
echo '<b>Форумы сообщества '.$comm['name'].': </b>';
$q = mysql_query("select * from `comm_forum_f` WHERE comm_id = '$soo' order by pos" );
while ($for = mysql_fetch_array($q))
{
$f = $for['id'];
$f_name = $for['name'];
$num = $db->sql_numrows($db->sql_query("select * from `comm_forum_msg` WHERE comm_id = '$soo' and f_id = '$f';"));
$kol = $db->sql_numrows($db->sql_query("select * from `comm_forum_t` WHERE comm_id = '$soo' and f_id = '$f';"));
$tem = @$db->sql_fetchrow($db->sql_query("select * from `comm_forum_t` WHERE comm_id = '$soo' and f_id = '$f' order by time desc limit 1;"));
echo '<dl></dl>';
echo links;
if ($admin['priv']==2) {
echo '<a href="admin_editf_'.$f.'?soo='.$soo.'"><img src="'.H.'img/p2.png" alt="*"/></a> <b><a href="razdel_'.$f.'?soo='.$soo.'">'.$f_name.'</a></b> ('.$kol.'/'.$num.') <a href="razdel_'.$f.'_end?soo='.$soo.'">>></a>';
} else{
echo '<img src="'.H.'img/p2.png" alt="*"/> <b><a href="razdel_'.$f.'?soo='.$soo.'">'.$f_name.'</a></b> ('.$kol.'/'.$num.') <a href="razdel_'.$f.'_end?comm_id='.$soo.'">>></a>';
}
echo div;
echo '<small>';
if ($user['razd']==1){
$q1 = $db->sql_query('SELECT * from `comm_forum_r` WHERE comm_id = "'.$soo.'?soo='.$soo.'" and f_id = "'.$f.'" order by pos limit 10;');
while ($for = @$db->sql_fetchrow($q1))
{
echo '<img src="'.H.'img/004.png" alt="*"/> <a href="temes_'.$for['id'].'?soo='.$soo.'">'.$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 />';
}
}
$k = @$db->sql_fetchrow($db->sql_query('SELECT * from `comm_forum_r` WHERE id = "'.$tem['r_id'].'";'));
echo 'Раздел: <a href="temes_'.$tem['r_id'].'?soo='.$soo.'">'.$k['name'].'</a><br />Тема: <a href="tema_'.$tem['id'].'_end?soo='.$soo.'">'.$tem['name'].'</a><br />';
$post = @$db->sql_fetchrow($db->sql_query("select * from `comm_forum_msg` WHERE t_id = '".$tem['id']."' order by time desc limit 1;"));
echo 'Сообщение: <a href="'.H.user_inf($post['user_id']).'">'.user($post['user_id']).'</a>';
echo '('.times($post['time']).')';
echo '</small>';
}
if ($admin['priv']==2) {echo '<br /><br /><dl><dt></dt></dl>';echo '<a href="admin_addf?soo='.$soo.'"><b>Создать</b></a><br/>';
}
echo '<dl><dt></dt></dl>';
?>