View file forum/inc/forum.php

File size: 1.25Kb
<?


$k_forum=0;

$q = mysql_query("SELECT * FROM `$mysql[pref]forum_f`;");

while ($forums = mysql_fetch_array($q))

{

$forum[$k_forum]=$forums;

$k_forum++;

}


if ($k_forum>0)

{

usort ($forum, "sroom");


echo "<div class=\"menu\">\n";


for ($i=0;$i<$k_forum;$i++)

{



if (isset($user) && $user['level']>2 && $user['slinks']==0)

{

echo "<a href=\"set_f.php?id_forum=".$forum[$i]['id']."\">\n";

}

echo "<img src=\"../SYSTEM/themes/$them/img/forum/forum.gif\" alt=\"\" />";

if (isset($user) && $user['level']>2 && $user['slinks']==0)

{

echo "</a>\n";

}


echo " <a href=\"index.php?id_forum=".$forum[$i]['id']."\"><b>".$forum[$i][name]."</b></a>";

$id_forum_t=$forum[$i]['id'];

$g = mysql_query("SELECT COUNT(*) FROM `$mysql[pref]forum_t` WHERE `id_f` = '$id_forum_t';");

$k_t=mysql_result($g, 0);


$g = mysql_query("SELECT COUNT(*) FROM `$mysql[pref]forum_p` WHERE `id_f` = '$id_forum_t';");

$k_p=mysql_result($g, 0);


echo " [$k_t/$k_p]";


echo "<br />\n";



}

echo "</div>\n";

}

else

{

echo "Нет форумов<br />\n";

}

echo "<hr />\n";



if (isset($user) && $user['level']>2 && $user['slinks']==0)

{

echo "<a href=\"add_f.php\">Добавить форум</a><br />\n";

}


?>