View file index.php

File size: 2.37Kb
<?php
// MyForum - Сервис форумов 
// Copyright © A'lex и KO. All Rights Reserved
// По всем вопросам обращайтесь на email [email protected] или в асю 376920428

include 'config.php';
include 'functions.php';

$wmode=getwmode($w);
$Caption=$foruminfo['Title'];
$BackLink=$foruminfo['BackLink'];

$r = mysql_query("SELECT * FROM {$table}{$f}_forums");
$body = "";
for($i=0; $i<mysql_numrows($r); $i++) {
	$a=mysql_fetch_array($r);
	$ForumID = $a['ID'];
	$ForumTitle = $a['Title'];
	$ForumInfo = $a['Info'];
	$k = mysql_query("SELECT * FROM {$table}{$f}_topiks WHERE ForumID=$ForumID AND Visible=0");
	$TopiksCount=mysql_numrows($k);
	$k = mysql_query("SELECT * FROM {$table}{$f}_messages WHERE ForumID=$ForumID AND Visible=0");
	$MessagesCount=mysql_numrows($k);
	$body=$body."<a href=\"showforum.php?f=$f&p={$a['ID']}$isid\">$ForumTitle</a> ($TopiksCount/$MessagesCount)<br/>$ForumInfo<br/><br/>\n";

}

if ($sid==FALSE) {
	$end = "<a href=\"login.php?f=$f$isid\">Вход</a><br/><a href=\"forumreg.php?f=$f$isid\">Регестрация</a><br/>";
} else {
	$lever = $userinfo['Lever'];
	$end = "<a href=\"online.php?f=$f$isid\">Кто на форуме</a><br/>";
	$end = $end . "<a href=\"password.php?f=$f$isid\">Сменить пароль</a><br/>";
	$end = $end . "<a href=\"anket.php?f=$f$isid\">Изменить анкету</a><br/>";
	if ($lever > 2) {$end = $end . "<a href=\"bannick.php?mode=show&f=$f$isid\">Бан по имени</a><br/>";}
	if ($lever > 2) {$end = $end . "<a href=\"banip.php?mode=show&f=$f$isid\">Бан по IP</a><br/>";}
	if ($lever > 3) {$end = $end . "<a href=\"users.php?mode=show&f=$f$isid\">Список пользователей</a><br/>";}
	if ($lever > 3) {$end = $end . "<a href=\"setup.php?mode=show&f=$f$isid\">Настройка форума</a><br/>";}
	if ($lever == 5) {$end = $end . "<a href=\"admin.php?mode=main&login=$AdminName&password=$AdminPassword\">Admin panel</a><br/>";}
	$end .= "<a href=\"exit.php?f=$f$isid\">Выход</a><br/>";

}
if ($wmode=='html')
{$Banner.="<a href=\"index.php?f=$f&sid=$sid&w=wml\">WML</a><br/>";} else
{$Banner.="<a href=\"index.php?f=$f&sid=$sid&w=html\">HTML</a><br/>";}
$end = $end . "<a href=\"faq.php?f=$f$isid\">FAQ</a><br/>";

$end = $end . $BackLink;
displaytext($Caption, $Banner, $body, $end, $w);
mysql_close($lnk);
?>