Файл: inc/forums.php
Строк: 32
<?php
// Криме / Krime
function listforums()
{
global $s_siteurl, $lang, $language;
echo '<div class="phdr">' . $lang['forums'] . '</div>';
$forums = mysql_query("SELECT * FROM `forums` ORDER BY `position` ASC;");
if(mysql_num_rows($forums) > 0)
{
while($forum = mysql_fetch_array($forums)){
echo'<div class="list2">';
$id = clean($forum['id']);
$title = clean($forum['title']);
$description = clean($forum['description']);
$description = bbcode($description);
$description = smile($description);
$query = mysql_query('SELECT COUNT(*) FROM `threads` WHERE `forum` = '' . $id . '';');
$result = mysql_fetch_array($query);
$threadsCount = intval($result[0]);
if(checkadmin())
{
$edl = ' <a href="/index.php?do=edit&what=forum&id=' . $id . '">[E]</a>';
$dll = ' <a href="/index.php?do=delete&what=forum&id=' . $id . '">[D]</a>';
}
else
{
$edl = '';
$dll = '';
}
echo '<a href="/forum.php?id='.$id.'">'.$title.' ('.$threadsCount.')</a>'.$edl.$dll.'<br />'.$description.'</div>';
}
}
else
{
echo '<div class="list2">' . $lang['noforums'] . '</div>';
}
if(checkadmin())
echo '<div class="list2"><a href="/index.php?do=new&what=forum">' . $lang['newforum'] . '</a></div>';
return;
}
?>