View file includes/main_forum/main.php

File size: 1.45Kb
<?php
if ($razdel>0) include($rootpath."topics.php");

print '<card id="forum" title="'.$title.'Форум">';
if (!$autorize) print '<do name="a" type="options" label="Войти"><go href="'.$forum.'/a/&amp;z='.$back_addr.'"/></do>';
print $mainkey;
print '<p>';
print $sysmsg;
print '<strong><a href="'.$forum.'/r">Правила</a></strong><br/><br/>';
print '<strong>Разделы</strong>:';

$q=mysql(DBName,"SELECT `l1` , `text` FROM `".$table."` WHERE 1 AND `l2` = 0 AND `l3` = 0 ORDER BY `l1` ASC LIMIT 0, 29");
$s=mysql_num_rows($q);

if ($s<1) print '<br/><small>[Разделы не определены]<br/>Обратитесь к администратору.</small><br/>';

for ($i=0;($i<$s);$i++)
	{
	$f=mysql_fetch_array($q);
	$text=cyr2utf(str_replace("$","$$",htmlspecialchars($f['text'])));
	$l1=$f['l1'];

    $q1=@mysql(DBName,"SELECT `status` FROM `$table` WHERE 1 AND `status` < 2 AND `l1` = $l1 AND `l2` != 0 AND `l3` = 0");
    $countertopic=@mysql_num_rows($q1)+0;

    $q1=@mysql(DBName,"SELECT `status` FROM `$table` WHERE 1 AND `status` < 2 AND `l1` = $l1 AND `l2` != 0 AND `l3` != 0");
    $countermsg=@mysql_num_rows($q1)+0;

	print '<br/>[<a href="'.$forum.'/show/'.$l1.'">'.$text.'</a>:'.$countertopic.'/'.$countermsg.']';
	}

if ($status==2) print '<br/><br/><a href="'.$forum.'/ar">Добавить</a>';
if ($status==2) print '<br/><a href="'.$forum.'/dr">Удалить</a>';
print $endtext;
exit();
?>