View file includes/service/forum10/main.php

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

print cyr2utf('<card id="forum" title="'.$title.'">');
if (!$autorize) print cyr2utf('<do name="a" type="options" label="Войти"><go href="'.$forum.'?a=a&amp;z='.base64_encode($QUERY_STRING).'"/></do>');
if ($autorize) print cyr2utf('<do name="faq" type="options" label="FAQ"><go href="'.$forum.'?'.$user.'&amp;a=faq"/></do>');
print '<p>';
print cyr2utf($sysmsg);
#print cyr2utf('<b><a href="'.$forum.'?'.$user.'&amp;a=r">Правила</a></b><br/>');
print cyr2utf('<b><a href="http://'.$site.'.kmx.ru/forum_rules.wml">Правила</a></b><br/>');
print cyr2utf('<br/><b>Разделы</b>:');

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

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

for ($i=0;($i<$s);$i++)
	{
	$f=@mysql_fetch_array($q);
	$text=$f['text'];
	$l1=$f['l1'];

    $q1=@mysql(DBName,"SELECT `status` FROM `$table` WHERE `domain` = '$domain' AND `site` = '$site' 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 `domain` = '$domain' AND `site` = '$site' AND `status` < 2 AND `l1` = $l1 AND `l2` != 0 AND `l3` != 0");
    $countermsg=@mysql_num_rows($q1)+0;

	print cyr2utf('<br/>[<a href="'.$forum.'?'.$user.'&amp;r='.$l1.'">'.$text.'</a>:'.$countertopic.'/'.$countermsg.']');
	}

if ($status==2) print cyr2utf('<br/><br/><a href="'.$forum.'?'.$user.'&amp;a=ar">Добавить</a>');
if ($status==2) print cyr2utf('<br/><a href="'.$forum.'?'.$user.'&amp;a=dr">Удалить</a>');
print cyr2utf(' <br/> <br/><small>Ваш статус: ');
switch ($status)
	{
	case '-1': print cyr2utf('"Только чтение"');break;
	case '0': print cyr2utf('"Пользователь"');break;
	case '1': print cyr2utf('"Модератор"');break;
	case '2': print cyr2utf('"Администратор"');break;
	default : print cyr2utf('~неопределен~');break;
	}
print "</small>";
print $endtext;
exit();
?>