Файл: Krimos/inc/forums.php
Строк: 61
<?php
// Криме / Krime
function listforums()
{
global $s_siteurl, $lang, $language;
echo ' <div class="left">' . "rn";
echo ' <div class="forums">' . "rn";
echo ' <div class="center"><span>' . $lang['forums'] . '</span></div>' . "rn";
$forums = mysql_query("SELECT * FROM `forums` ORDER BY `position` ASC;");
if(mysql_num_rows($forums) > 0)
{
while($forum = mysql_fetch_array($forums))
{
$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="' . $s_siteurl . '/index.php?lang=' . $language . '&do=edit&what=forum&id=' . $id . '">[E]</a>';
$dll = ' <a href="' . $s_siteurl . '/index.php?lang=' . $language . '&do=delete&what=forum&id=' . $id . '">[D]</a>';
}
else
{
$edl = '';
$dll = '';
}
echo ' <span><a href="' . $s_siteurl . '/forum.php?lang=' . $language . '&id=' . $id . '">' . $title . ' (' . $threadsCount . ')</a>' . $edl . $dll . '</span><br />' . "rn";
echo ' <span>' . $description . '</span><br />' . "rn";
}
}
else
{
echo ' <span>' . $lang['noforums'] . '</span><br />' . "rn";
}
if(checkadmin())
echo ' <div class="center"><span><a href="' . $s_siteurl . '/index.php?lang=' . $language . '&do=new&what=forum">' . $lang['newforum'] . '</a></span></div>' . "rn";
echo ' </div>' . "rn";
echo ' </div>' . "rn";
return;
}
?>