Файл: api_forum/index.php
Строк: 36
<?
////////////////////////////////////////
///// Основа ApiCMS //////
///// Автор биллинга - IvanDanilov /////
///// Автор биллинга - IvanDanilov /////
///// ICQ 936545, mail: KyberID@ya.ru //
////////////////////////////////////////
/////////////////////////////////////////
$title = 'Форум';
require_once '../api_core/apicms_system.php';
require_once '../api_core/head.php';
/////////////////////////////////////////
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `api_forum_razdel`"),0);
$k_page=k_page($k_post,$api_settings['on_page']);
$page=page($k_page);
$start=$api_settings['on_page']*$page-$api_settings['on_page'];
if ($k_post==0)echo "<div class='content'><center>Разделов не найдено!</center></div>";
/////////////////////////////////////////
$qii=mysql_query("SELECT * FROM `api_forum_razdel` ORDER BY id DESC LIMIT $start, $api_settings[on_page]");
while ($post_forum = mysql_fetch_assoc($qii)){
$counts = mysql_result(mysql_query("SELECT COUNT(*) FROM `api_forum_subforum` WHERE `razdel` = '$post_forum[id]'"), 0);
echo '<div class="subhead"><table width="100%" ><tr><td width="10%"><center><img src="/design/forum/razdel.png">';
echo "</center></td><td width='90%'>";
if ($user['level']==1 or $user['level']==2) echo ' <a href="delete_razdel.php?id='.$post_forum['id'].'"><img src="/design/forum/del_theme.png"></a> ';
echo "<a href='subforum.php?id=$post_forum[id]'><b>".htmlspecialchars($post_forum['name'])." </b></a> ";
echo "<span style='float:right'> <small>".apicms_data($post_forum['time'])."</span> </br>";
if ($post_forum['opisanie']!=NULL)echo ''.htmlspecialchars($post_forum['opisanie']).'';
echo " <span style='float:right'> Всего: ".$counts." </small></span></br></td></tr></table></div>";
}
/////////////////////////////////////////
if ($k_page > 1){
echo '<div class="subhead"><center>';
str('&',$k_page,$page); // генерируем постраничную навигацию
echo '</center></div>';
}
/////////////////////////////////////////
if ($user['level']==1 or $user['level']==2)echo "<div class='subhead'> - <a href='razdel_create.php'>Создать новый раздел</a></div>";
/////////////////////////////////////////
apicms_foot();
?>