Файл: include/mindex.php
Строк: 162
<?
if( in_array($status, array('admin', 'moderator')) )
{
list($maxOnl, $time) = explode("<>", file_get_contents("online.txt"));
$online = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `session`
WHERE `time` > ".(time() - (10 * 60))), 0);
if($online > intval($maxOnl))
{
fwrite(fopen('online.txt', 'w'), $online.'<>'.date('d.m.y H:i:s'));
}
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
header("Cache-Control: no-cache");
echo(doctype("".date('H:i')." Модер-форум")."rn");
echo($tag);
if($authorize)
{
echo('<a href="./?p=24&v=wml&sid='.$sid.'">Приват');
$private = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `private`
WHERE `name`='".$username."'
AND `new`=1
AND `mod`='i'"), 0);
echo((empty($private) ? ' - 0</a>' : '</a> - <a href="./?p=24&v=wml&sid='.$sid.'&new=1">'.$private.'</a>'));
$sten = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE username='".$username."'"));
$stenid=$sten['id'];
echo(" | <a href="./?p=29&sid=".$sid."&v=wml">Стена");
$st = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `stena`
WHERE `stenid`='".$stenid."'
AND `s`=1"), 0);
//echo((empty($st) ? ' - 0</a>' : '</a> - <a href="./?p=29&stenid='.$stenid.'&v=xhtml&sid='.$sid.'&sn=1">'.$st.'</a>'));
echo((empty($st) ? ' - 0</a>' : ' - '.$st.'</a>'));
echo("<br />");
echo('<a href="./?p=0&v=wml&sid='.$sid.'">Общий форум</a> | ');
if($status == "admin")
{
echo('<a href="./?p=27&v=wml&sid='.$sid.'"><b>Админка</b></a> | ');
}
if( in_array($status, array('admin', 'moderator')) )
{
echo("<a href='./?p=26&back=" . base64_encode(htmlspecialchars($_SERVER['REQUEST_URI'])) . "&sid=$sid&v=wml'>Бан по нику</a><br />rn");
}
}
$mmfs = mysql_query("SELECT *
FROM mforums
ORDER BY mforums.pos"
);
$mmaPosts = mysql_fetch_assoc(
mysql_query("SELECT COUNT(*) AS cnt, MAX(mposts.time) AS mt
FROM mposts
LEFT JOIN mthemes
ON mposts.id_theme=mthemes.id"));
while($mmforums = mysql_fetch_assoc($mmfs))
{
$mmpcnt = mysql_fetch_assoc(
mysql_query("SELECT COUNT(*) AS cnt, MAX(mposts.time) AS mt
FROM mposts
LEFT JOIN mthemes
ON mposts.id_theme=mthemes.id
WHERE id_forum=".$mmforums['id']));
$mmlastTimeQ = mysql_query("SELECT * FROM `mcounter`
WHERE `username`='".$username."'
AND `fid`=".$mmforums['id']);
$mmlastTimeR = mysql_fetch_assoc($mmlastTimeQ);
$mmlastTime = $mmlastTimeR['time'];
$mmnPosts = mysql_result(
mysql_query("SELECT COUNT(*)
FROM mposts, mthemes
WHERE mposts.id_theme=mthemes.id
AND id_forum=".$mmforums['id']."
AND mposts.time > '".$mmlastTime."'
AND mposts.name != '".$username."'
GROUP BY mthemes.id_forum"), 0);
if($mmnPosts < 1)
{
$mmnPosts = '0';
}
$mmnQPosts = $mmnPosts+$mmnQPosts;
}
echo("<br/>Новых/Всего: <b>(".intval($mmnQPosts)."/".intval($mmaPosts['cnt']).")</b><br />");
}
elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
header("Last-Modified:".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>'.date('H:i').' Модер-форум</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'">
<font color="#FFFFFF"><b>Модер-форум</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">
'.$tag.'');
if($authorize)
{
echo('<a href="./?p=24&v=xhtml&sid='.$sid.'">Приват');
$private = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `private`
WHERE `name`='".$username."'
AND `new`=1
AND `mod`='i'"), 0);
echo((empty($private) ? ' - 0</a>' : '</a> - <a href="./?p=24&v=xhtml&sid='.$sid.'&new=1">'.$private.'</a>'));
$sten = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE username='".$username."'"));
$stenid=$sten['id'];
echo(" | <a href="./?p=29&sid=".$sid."&v=xhtml">Стена");
$st = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `stena`
WHERE `stenid`='".$stenid."'
AND `s`=1"), 0);
//echo((empty($st) ? ' - 0</a>' : '</a> - <a href="./?p=29&stenid='.$stenid.'&v=xhtml&sid='.$sid.'&sn=1">'.$st.'</a>'));
echo((empty($st) ? ' - 0</a>' : ' - '.$st.'</a>'));
echo("<br />");
}
echo('<a href="./?p=0&v=xhtml&sid='.$sid.'"><b>Общий форум</b></a> | ');
if($status == "admin")
{
echo('<a href="./?p=27&v=xhtml&sid='.$sid.'"><b>Админка</b></a> | ');
}
if( in_array($status, array('admin', 'moderator')) )
{
echo("<a href='./?p=26&back=" . base64_encode(htmlspecialchars($_SERVER['REQUEST_URI'])) . "&sid=$sid&v=xhtml'>Бан по нику</a><br />rn");
}
$mmfs = mysql_query("SELECT *
FROM mforums
ORDER BY mforums.pos"
);
$mmaPosts = mysql_fetch_assoc(
mysql_query("SELECT COUNT(*) AS cnt, MAX(mposts.time) AS mt
FROM mposts
LEFT JOIN mthemes
ON mposts.id_theme=mthemes.id"));
while($mmforums = mysql_fetch_assoc($mmfs))
{
$mmpcnt = mysql_fetch_assoc(
mysql_query("SELECT COUNT(*) AS cnt, MAX(mposts.time) AS mt
FROM mposts
LEFT JOIN mthemes
ON mposts.id_theme=mthemes.id
WHERE id_forum=".$mmforums['id']));
$mmlastTimeQ = mysql_query("SELECT * FROM `mcounter`
WHERE `username`='".$username."'
AND `fid`=".$mmforums['id']);
$mmlastTimeR = mysql_fetch_assoc($mmlastTimeQ);
$mmlastTime = $mmlastTimeR['time'];
$mmnPosts = mysql_result(
mysql_query("SELECT COUNT(*)
FROM mposts, mthemes
WHERE mposts.id_theme=mthemes.id
AND id_forum=".$mmforums['id']."
AND mposts.time > '".$mmlastTime."'
AND mposts.name != '".$username."'
GROUP BY mthemes.id_forum"), 0);
if($mmnPosts < 1)
{
$mmnPosts = '0';
}
$mmnQPosts = $mmnPosts+$mmnQPosts;
}
echo("Новых/Всего: <b>(".intval($mmnQPosts)."/".intval($mmaPosts['cnt']).")</b><br />");
echo($tagC);
echo('</td></tr><tr><td bgcolor="'.$style['text'].'">'.$tag);
}
$f = mysql_query("SELECT *
FROM mforums
ORDER BY mforums.pos"
);
while($forums = mysql_fetch_assoc($f))
{
$pcnt = mysql_fetch_assoc(
mysql_query("SELECT COUNT(*) AS cnt, MAX(mposts.time) AS mt
FROM mposts
LEFT JOIN mthemes
ON mposts.id_theme=mthemes.id
WHERE id_forum=".$forums['id']));
if($authorize)
{
$lastTimeQ = mysql_query("SELECT * FROM `mcounter`
WHERE `username`='".$username."'
AND `fid`=".$forums['id']);
$lastTimeR = mysql_fetch_assoc($lastTimeQ);
$lastTime = $lastTimeR['time'];
$newPosts = @intval(
mysql_result(
mysql_query("SELECT COUNT(*)
FROM mposts, mthemes
WHERE mposts.id_theme=mthemes.id
AND id_forum=".$forums['id']."
AND mposts.time > '".$lastTime."'
AND mposts.name != '".$username."'
GROUP BY mthemes.id_forum"), 0)).'/';
if($newPosts < 1)
{
$newPosts = '0/';
}
}
echo(date("d/m H:i", $pcnt['mt'])."<b>(".$newPosts.intval($pcnt['cnt']).")</b><br />rn");
echo('<b><a href="./?p=3&f='.$forums['id'].'&sid='.$sid.'&v='.$version.'">'.$forums['name'].'</a></b><br /> <br />');
}
$fonl = mysql_query("SELECT nickname FROM `session` WHERE `time` > ".(time() - (10 * 60)));
$uonl = mysql_num_rows($fonl);
if($version == "wml")
{
echo('<br />');
if($authorize)
{
echo('<a href="./?p=12&sid='.$sid.'&v=wml&rnd='.$ref.'">Online: <b>'.intval($uonl).'</b></a><br />');
}
echo('<a href="./?p=20&v=wml&sid='.$sid.'">Поиск</a> | ');
//echo('<a href="./?p=13&sid='.$sid.'&v=wml">Топ-20</a> | ');
//echo('<a href="./?p=11&sid='.$sid.'&v=wml">Статистика</a> | ');
echo('<a href="./?p=14&v=wml&sid='.$sid.'">Помощь</a> | ');
if($authorize)
{
echo('<a href="./?p=28&logout=1&v=wml&sid='.$sid.'"><b>Выход</b></a><br />');
}
echo($tagC.'
</p></card></wml>');
}
elseif($version == "xhtml")
{
echo($tagC.'</td></tr>');
echo("<tr><td bgcolor="".$style['bottom']."">rn".$tag);
if($authorize)
{
echo('<a href="./?p=12&sid='.$sid.'&v=xhtml&rnd='.$ref.'">Online: <b>'.intval($uonl).'</b></a><br />');
}
echo('<a href="./?p=20&v=xhtml&sid='.$sid.'">Поиск</a> | ');
//echo('<a href="./?p=13&sid='.$sid.'&v=xhtml">Топ-20</a> | ');
//echo('<a href="./?p=11&sid='.$sid.'&v=xhtml">Статистика</a> | ');
echo('<a href="./?p=14&v=xhtml&sid='.$sid.'">Помощь</a> | ');
if($authorize)
{
echo('<a href="./?p=28&logout=1&v=xhtml&sid='.$sid.'"><b>Выход</b></a><br />');
}
echo($tagC.'</td></tr></table>
</body></html>');
}}
?>