Файл: index.php
Строк: 1307
<?php
include_once("connect.php"); // Подключение...
include_once("functions.php"); // Файл с функциями
include_once("config.php"); // Файл конфигурации
include_once("users.php"); // Данные о пользователе
list($msec,$sec)=explode(chr(32),microtime());
$headtime=$sec+$msec;
if(!$authorize) ClearOnline(); else RefreshSid($username);
switch($_GET['mode'])
{
default:
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');
echo(doctype("Форумы ONY.SU")."rn");
echo($tag);
if($authorize)
{
echo('<a href="private.php?v=wml&sid='.$sid.'">Приват</a>');
$private = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `private`
WHERE `name`='".$username."'
AND `new`=1
AND `mod`='i'"), 0);
echo((empty($private) ? '' : ' - <a href="private.php?v=wml&sid='.$sid.'&new=1">'.$private.'</a>'));
echo("<br />rn");
if($status == "admin")
{
echo('-<a href="admin.php?v=wml&sid='.$sid.'">Админка</a><br />');
}
if( in_array($status, array('admin', 'moderator')) )
{
echo("-<a href='ban.php?back=" . base64_encode(htmlspecialchars($_SERVER['REQUEST_URI'])) . "&sid=$sid&v=wml'>Бан по нику</a><br />rn");
}
}
}
elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Форумы ONY.SU</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>Форумы ONY.SU</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">
'.$tag.'');
if($authorize)
{
echo('<a href="private.php?v=xhtml&sid='.$sid.'">Приват</a>');
$private = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `private`
WHERE `name`='".$username."'
AND `new`=1
AND `mod`='i'"), 0);
echo((empty($private) ? '' : ' - <a href="private.php?v=xhtml&sid='.$sid.'&new=1">'.$private.'</a>'));
}
if($status == "admin")
{
echo('<br />-<a href="admin.php?v=xhtml&sid='.$sid.'">Админка</a><br />');
}
if( in_array($status, array('admin', 'moderator')) )
{
echo("-<a href='ban.php?back=" . base64_encode(htmlspecialchars($_SERVER['REQUEST_URI'])) . "&sid=$sid&v=xhtml'>Бан по нику</a><br />rn");
}
echo($tagC);
echo('</td></tr><tr><td bgcolor="'.$style['text'].'">'.$tag);
}
$f = mysql_query("SELECT *
FROM forums
ORDER BY forums.pos"
);
while($forums = mysql_fetch_assoc($f))
{
$pcnt = mysql_fetch_assoc(
mysql_query("SELECT COUNT(*) AS cnt, MAX(posts.time) AS mt
FROM posts
LEFT JOIN themes
ON posts.id_theme=themes.id
WHERE id_forum=".$forums['id']));
if($authorize)
{
$lastTimeQ = mysql_query("SELECT * FROM `counter`
WHERE `username`='".$username."'
AND `fid`=".$forums['id']);
$lastTimeR = mysql_fetch_assoc($lastTimeQ);
$lastTime = $lastTimeR['time'];
$newPosts = @intval(
mysql_result(
mysql_query("SELECT COUNT(*)
FROM posts, themes
WHERE posts.id_theme=themes.id
AND id_forum=".$forums['id']."
AND posts.time > '".$lastTime."'
AND posts.name != '".$username."'
GROUP BY themes.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="./?f='.$forums['id'].'&sid='.$sid.'&v='.$version.'&mode=topics">'.$forums['name'].'</a></b><br /> <br />');
}
if($version == "wml")
{
echo('<br />');
if(!$authorize)
{
echo('<a href="auth.php?v=wml">Авторизация</a><br />');
} else
{
echo('<a href="./?v=wml&sid='.$sid.'&mode=exit">Выход</a><br />');
}
echo('<a href="search.php?v=wml&sid='.$sid.'">Поиск</a><br />
<a href="./?v=wml&mode=help&sid='.$sid.'">Помощь</a><br />
<a href="'.$mainsite.'">Главная</a><br />
WML|<a href="./?v=xhtml&sid='.$sid.'">XHTML</a>
'.$tagC.'
</p></card></wml>');
}
elseif($version == "xhtml")
{
echo($tagC.'</td></tr>');
echo("<tr><td bgcolor="".$style['bottom']."">rn".$tag);
if(!$authorize)
{
echo('<a href="auth.php?v=xhtml">Авторизация</a><br />');
} else
{
echo('<a href="./?v=xhtml&mode=exit&sid='.$sid.'">Выход</a><br />');
}
echo('<a href="search.php?v=xhtml&sid='.$sid.'">Поиск</a><br />
<a href="./?v=xhtml&mode=help&sid='.$sid.'">Помощь</a><br />
<a href="'.$mainsite.'">Главная</a><br />
<a href="./?sid='.$sid.'&v=wml">WML</a>|XHTML
'.$tagC.'</td></tr></table>
</body></html>');
}
break;
case 'topics':
$f = intval($_GET['f']);
$forums = mysql_query("SELECT * FROM forums
WHERE id=".$f);
if(mysql_num_rows($forums) < 1)
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'Такого подфорума не существует! <br />
-
<a href="index.php?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'
</p></card></wml>');
}
elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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['text'].'">'.$tag.'
Такого подфорума не существует!
'.$tagC.'
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">
<a href="index.php?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
</td></tr></table>
</body></html>');
}
} else
{
// Навигация
$count = mysql_result(
mysql_query("SELECT COUNT(*)
FROM themes
WHERE id_forum=".$f), 0);
$start = intval($_GET['s']);
if(!empty($start))
{
$limit = "LIMIT ".$start.", ".abs($count - $start);
$int = $start;
}
else
{
$int = 0;
}
// Заголовок
$forRows = mysql_fetch_assoc($forums);
$title = $forRows['name'];
if($authorize)
{
if(!mysql_result(
mysql_query("SELECT COUNT(*)
FROM `counter`
WHERE `username`='".$username."'
AND `fid`=".$f), 0))
{
mysql_query("INSERT INTO `counter`
VALUES(0, '".$username."', ".$f.", (SELECT MIN(time)FROM posts))");
}
$lastTimeQ = mysql_query("SELECT `time`
FROM `counter`
WHERE `username`='".$username."'
AND `fid`=".$f);
$lastTimeR = mysql_fetch_assoc($lastTimeQ);
$lastTime = $lastTimeR['time'];
}
if($version == "wml")
{
$validChar = '$$';
}
else
{
$validChar = '$';
}
$thisPageSize = 750;
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype($title));
echo($tag."<a href="./?v=wml&sid=".$sid."">Форумы ONY.SU</a><br />rn");
if($private = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `private`
WHERE `name`='".$username."'
AND `new`=1
AND `mod`='i'"), 0))
{
echo("<a href="private.php?v=wml&sid=".$sid."">Приват</a> - <a href="private.php?v=wml&sid=".$sid."&new=1">".$private."</a><br />rn");
}
if($authorize)
{
if($order == 0)
{
echo("<a href="./?v=wml&sid=".$sid."&mode=reSort&f=".$f."">Популярные темы</a><br />rn");
}
else
{
echo("<a href="./?v=wml&sid=".$sid."&mode=reSort&f=".$f."">Последние темы</a><br />rn");
}
}
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>'.$title.'</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>'.$title.'</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">'.$tag.'
<a href="./?v=xhtml&sid='.$sid."">Форумы ONY.SU</a><br />rn");
if($private = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `private`
WHERE `name`='".$username."'
AND `new`=1
AND `mod`='i'"), 0))
{
echo('<a href="private.php?v=xhtml&sid='.$sid.'">Приват</a> - <a href="private.php?v=xhtml&sid='.$sid.'&new=1">'.$private.'</a><br />');
}
if($authorize)
{
if($order == 0)
{
echo("<a href="./?v=xhtml&sid=".$sid."&mode=reSort&f=".$f."">Популярные темы</a><br />rn");
}
else
{
echo("<a href="./?v=xhtml&sid=".$sid."&mode=reSort&f=".$f."">Последние темы</a><br />rn");
}
}
echo($tagC."</td></tr>rn");
echo("<tr><td bgcolor="".$style['text']."">rn".$tag);
if($status == "moderator" OR $status == "admin")
{
echo("<form action="moder.php?v=xhtml&sid=".$sid."&fid=".$f."&mode=checkbox" method="post">rn");
}
}
if($status != "admin")
{
$noDel = "`del`=0 AND";
}
if($authorize && $order == 1)
{
$SQL = "SELECT themes.*, MAX(posts.id) AS mpid, COUNT(posts.id) AS cnt
FROM themes, posts
WHERE posts.id_theme=themes.id
AND themes.id_forum=".$f."
GROUP BY themes.id
ORDER BY pos, mpid DESC
".$limit;
}
else
{
$SQL = "SELECT themes . * , COUNT( posts.id ) AS cnt
FROM themes , posts
WHERE ".$noDel." id_forum = ".$f."
AND posts.id_theme = themes.id
GROUP BY themes.id
ORDER BY `pos` , `id` DESC
".$limit;
}
$topicsa = mysql_query($SQL);
if($authorize)
{
while($topics = mysql_fetch_assoc($topicsa))
{
static $s;
$s += strlen($topics['tname'].$topics['name'].$topics['time']);
$topics['cnt'] = $topics['cnt'] - 1;
echo('<br />');
if(($status == "moderator" || $status == "admin") && $version == "xhtml")
{
echo("<input type="checkbox" name="id[]" value="".$topics['id']."" />rn");
}
echo(date("d.m H:s ", $topics['time'])."rn");
if($topics['close'] == "on")
{
echo(' <b>#</b> ');
}
if($topics['pos'] < 1)
{
echo(' <b>!</b> ');
}
$newPosts = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `posts`
WHERE `time` > '".$lastTime."'
AND `name` != '".$username."'
AND `id_theme`=".$topics['id']), 0);
echo("<b><a href="private.php?uid=".UserName2id($topics['name'])."&v=".$version."&sid=".$sid."&p=1">".$topics['name']."</a></b>rn");
if($status == "moderator" or $status == "admin")
{
echo(' <a href="moder.php?id='.$topics['id'].'&v='.$version.'&sid='.$sid."&mode=mtopic">X</a>rn");
}
if($topics['del'] == "1" AND $status == "admin" ) { echo('<i>'); }
echo('<br /><b><a href="index.php?p='.$topics['id'].'&v='.$version.'&sid='.$sid.'&mode=posts">'.str_replace('$', $validChar, $topics['tname'])."</a></b>rn");
if($topics['del'] == "1" AND $status == "admin" ) { echo('</i>'); }
echo('(');
if($newPosts > $topics['cnt'])
{
$newPosts = $topics['cnt'];
}
if($newPosts > 1 && $topics['cnt'] != 0)
{
echo(($newPosts).'/');
} elseif($newPosts == 1 && $topics['cnt'] != 0)
{
echo('1/');
}
echo($topics['cnt'].') <br />');
echo("<br />rn");
$int++;
if($s + 1000 > $pageSize)
{
if($int != $count)
{
$next = $int;
}
break;
}
}
} else
{
while($topics = mysql_fetch_assoc($topicsa))
{
static $s;
$s += strlen($topics['tname'].$topics['name'].$topics['time']);
echo("<br />rn");
echo(date("d.m H:s ", $topics['time'])."rn");
if($topics['close'] == "on")
{
echo(' <b>#</b> ');
}
if($topics['pos'] < 1)
{
echo(' <b>!</b> ');
}
echo("<b>".$topics['name']."</b>rn");
echo('<br /><b><a href="index.php?p='.$topics['id'].'&v='.$version.'&mode=posts">'.str_replace('$', $validChar, $topics['tname'])."</a></b>rn");
echo('('.$topics['cnt'].') <br />');
$int++;
if($s + 1500 > $pageSize)
{
if($int != $count)
{
$next = $int;
}
break;
}
}
}
if($version == "wml")
{
echo('<br />');
if(!empty($next))
{
echo("<a accesskey="3" href="./?v=wml&sid=".$sid."&f=".$f."&s=".$next."&mode=topics">Дальше...(3)</a><br />rn");
}
echo("<a href="./?v=wml&sid=".$sid."&mode=newt&f=".$f."">Новая тема</a><br />rn");
echo('<a href="'.htmlspecialchars($_SERVER['REQUEST_URI']).'&'.time().'">В начало</a>
'.$tagC.'
</p></card></wml>');
} elseif($version == "xhtml")
{
echo($tagC."</td></tr>
<tr><td bgcolor="".$style['bottom']."">rn".$tag);
if(!empty($next))
{
echo("<a href="./?v=xhtml&sid=".$sid."&f=".$f."&s=".$next."&mode=topics">Дальше...</a><br />rn");
}
if($status == "admin" or $status == "moderator")
{
echo("<input type="submit" value="Удалить отмечанные" /><br />rn</form>");
}
echo('<a href="./?v=xhtml&sid='.$sid.'&mode=newt&f='.$f."">Новая тема</a><br />rn");
echo('
<a href="'.htmlspecialchars($_SERVER['REQUEST_URI']).'&'.time()."">В начало</a>
".$tagC."</td></tr>
</table>
</body></html>rn");
}
}
break;
case 'posts':
$p = intval($_GET['p']);
$queryTheme = mysql_query("SELECT * FROM themes WHERE id=".$p);
$info = mysql_fetch_assoc($queryTheme);
if(mysql_num_rows($queryTheme) < 1)
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'Темы не существует! <br />
-
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'
</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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'].'">'.$tag.'
<font color="#FFFFFF"><b>Ошибка</b></font>
'.$tagC.'
</td></tr>
<tr><td bgcolor="'.$style['text'].'">'.$tag.'
<div class="text">Темы не существует!
'.$tagC.'
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">'.$tag.'
<div class="bottom"><a href="index.php?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'
</td></tr></table>
</body></html>');
}
} elseif($info['del'] == 1 and $status != 'admin')
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'
Тема '.$info['tname'].' из '.mysql_num_rows($queryTheme).' сообщений была удалена модератором '.$info['mdel'].'!<br />
-
<a href="./?v=wml&sid='.$sid.'&mode=topics&f='.$info['id_forum'].'">Назад</a><br />
<a href="./?v=wml">Форумы ONY.SU</a>
'.$tagC.'
</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>'.$info['tname'].'</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>'.$info['tname'].'</b></font>
</td></tr>
<tr><td bgcolor="'.$style['text'].'">'.$tag.'
Тема '.$info['tname'].' из '.mysql_num_rows($queryTheme).' сообщений была удалена модератором '.$info['mdel'].'!
'.$tagC.'
</td></tr>
<tr><td align="center" bgcolor="'.$style['bottom'].'">'.$tag.'
<a href="./?v=xhtml&sid='.$sid.'&mode=topics&f='.$info['id_forum'].'">Назад</a><br />
<a href="index.php?v=xhtml">Форумы ONY.SU</a>
'.$tagC.'
</td></tr></table>
</body></html>');
}
} else
{
if(($status == "moderator" || $status == "admin" || is_author($p, $username)) and !empty($_GET['o']))
{
mysql_query("UPDATE `themes` SET `close`='off' WHERE `id`=".$p);
}
$title = $info['tname'];
$back = mysql_fetch_assoc(mysql_query("SELECT *
FROM `forums`
WHERE `id`=".$info['id_forum']));
$count = mysql_result(
mysql_query("SELECT COUNT(*)
FROM posts
WHERE id_theme=".$p), 0);
if(empty($_GET['ss']))
{
$start = intval($_GET['s']);
}
else
{
$start = intval($_GET['ss']) - 1;
}
if(!empty($start))
{
$limit = "LIMIT ".$start.", ".abs($count - $start);
$int = $start;
}
else
{
$int = 0;
}
if($version == "xhtml")
{
$validChar = '$';
}
else
{
$validChar = '$$';
}
$thisPageSize = 750;
if($authorize)
{
$lastTimeQ = mysql_query("SELECT * FROM `counter`
WHERE `username`='".$username."'
AND `fid`=".$back['id']);
$lastTimeR = mysql_fetch_assoc($lastTimeQ);
$lastTime = $lastTimeR['time'];
$lastMsgTime = mysql_result(
mysql_query("SELECT MAX(time)
FROM posts
WHERE id_theme = ". $p), 0);
if($lastTime <= $lastMsgTime)
{
RefreshLastTime($username, $info['id_forum'], $lastMsgTime);
}
}
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype($title).$tag);
if($count > 5)
{
echo("<a accesskey="1" href="./?v=wml&sid=".$sid."&p=".$p."&s=".($count - 5)."&mode=posts">Вниз (1)</a><br />rn");
}
if($count > ceil($count / ($pageSize / 1000)))
{
echo("<a href="./?v=wml&sid=".$sid."&p=".$p."&c=".$count."&mode=qt">Перейти к[1-".$count."]</a><br />rn");
}
if($private = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `private`
WHERE `name`='".$username."'
AND `new`=1
AND `mod`='i'"), 0))
{
echo('<a href="private.php?v=wml&sid='.$sid.'">Приват</a> - <a href="private.php?v=wml&sid='.$sid.'&new=1">'.$private."</a><br />rn");
}
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>'.$title.'</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>'.$title.'</b></font>
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">'.$tag);
if($count > 5)
{
echo("<a href="./?v=xhtml&sid=".$sid."&p=".$p."&s=".($count - 5)."&mode=posts">Вниз</a><br />rn");
}
if($count > ceil(($count / ($pageSize / 1000))))
{
echo("<a href="./?v=xhtml&sid=".$sid."&p=".$p."&c=".$count."&mode=qt">Перейти к[1-".$count."]</a><br />rn");
}
if($private = mysql_result(
mysql_query("SELECT COUNT(*)
FROM `private`
WHERE `name`='".$username."'
AND `new`=1
AND `mod`='i'"), 0))
{
echo('<a href="private.php?mode=inbox&v=xhtml&sid='.$sid.'">Приват</a> - <a href="private.php?v=xhtml&sid='.$sid.'&mode=inbox&new=1">'.$private."</a><br />rn");
}
echo($tagC."</td></tr>
<tr><td bgcolor="".$style['text']."">rn".$tag);
if($status == "moderator" || $status == "admin")
{
echo("<form action="moder.php?v=xhtml&sid=".$sid."&tid=".$p."&mode=checkbox" method="post">rn");
}
}
$aposts = mysql_query("SELECT *
FROM `posts`
WHERE id_theme=".$p."
ORDER BY `id`
".$limit);
while($posts = mysql_fetch_assoc($aposts))
{
static $s;
echo(date("d.m H:i", $posts['time'])."rn");
if(!$authorize)
{
echo("<b>".$posts['name']."</b>rn");
} else
{
echo('<b><a href="private.php?p=1&uid='.UserName2id($posts['name']).'&v='.$version.'&sid='.$sid.'">'.$posts['name']."</a></b>rn");
}
if($status == "moderator" or $status == "admin")
{
echo(' <a href="moder.php?id='.$posts['id'].'&v='.$version.'&sid='.$sid.'&mode=mpost&tid='.$posts['id_theme']."">X</a><br />rn");
echo('['.strtok($posts['useragent'], '/').' '.$posts['ip']."]rn");
}
if($status == "moderator" || $status == "admin" && $version == "xhtml")
{
echo("<input type="checkbox" name="id[]" value="".$posts['id']."" />rn");
}
echo('<br />'.nl2br(str_replace('$', $validChar, $posts['post']))."<br /><br /> rn");
$int++;
$s += strlen($posts['post'].$posts['name'].$posts['time']);
if($s + $thisPageSize + (110 * abs($int - $start)) > $pageSize)
{
if($int != $count)
{
$next = $int;
}
break;
}
}
if($version == "wml")
{
echo('');
if($info['close'] == "on")
{
echo('<b>Тема закрыта</b><br />');
if(is_author($p, $username) or $status == "moderator" or $status == "admin")
{
echo('[<a href="./?v=wml&sid='.$sid.'&mode=posts&o=1&p='.$p.'">Открыть</a>]<br />');
}
}
if($authorize && $info['close'] != "on" )
{
echo('<a href="./?v=wml&sid='.$sid.'&mode=ans&f='.$p.'">Ответить</a><br />');
}
if(!empty($next))
{
echo("<a accesskey="3" href="./?v=wml&sid=".$sid."&mode=posts&s=".$next."&p=".$p."">Дальше...(3)</a><br />rn");
}
if($info['del'] == 1)
{
echo('Тема была удалена модератором '.$info['mdel']."<br />rn");
}
echo('<a href="./?f='.$back['id'].'&sid='.$sid.'&v=wml&mode=topics">Назад в «'.$back['name'].'»</a>
'.$tagC.'
</p></card></wml>');
} elseif($version == "xhtml")
{
echo($tagC."</td></tr>
<tr><td bgcolor="".$style['bottom']."">rn".$tag);
if($info['close'] == "on")
{
echo('<b>Тема закрыта</b><br />');
if(is_author($p, $username) or $status == "moderator" or $status == "admin")
{
echo('[<a href="./?v=xhtml&sid='.$sid.'&mode=posts&o=1&p='.$p.'">Открыть</a>]<br />');
}
}
if($authorize && $info['close'] != "on" )
{
echo('<a href="./?v=xhtml&sid='.$sid.'&mode=ans&f='.$p."">Ответить</a><br />rn");
}
if(!empty($next))
{
echo("<a href="./?v=xhtml&sid=".$sid."&mode=posts&s=".$next."&p=".$p."">Дальше...</a><br />rn");
}
if($info['del'] == 1)
{
echo('Тема была удалена модератором '.$info['mdel']."<br />rn");
}
echo('<a href="./?v=xhtml&sid='.$sid.'&f='.$back['id'].'&mode=topics">Назад в «'.$back['name']."»</a><br />rn");
if($status == "moderator" || $status == "admin")
{
echo("<input type="submit" value="Удалить отмечанные" />rn");
}
echo($tagC."</td></tr></table>rn</body></html>");
}
}
break;
case 'user':
$id = intval($_GET['id']);
if(($status == "moderator" OR $status == "admin") AND !empty($_POST['rat']))
{
mysql_query("UPDATE users
SET rating=rating+".intval($_POST['rat'])."
WHERE id=".$id);
}
if(($status == "moderator" OR $status == "admin") AND !empty($_POST['antirat']))
{
mysql_query("UPDATE users
SET antirating = antirating + ".intval($_POST['antirat'])."
WHERE id=".$id);
}
$query = mysql_query("SELECT * FROM users WHERE id=".$id);
$q = mysql_fetch_assoc($query);
if(mysql_num_rows($query) < 1)
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'Пользователя не существует! <br />
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a> '.$tagC.'
</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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['text'].'">'.$tag.'
Пользователя не существует!
'.$tagC.'
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">'.$tag.'
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a> '.$tagC.'
</td></tr></table>
</body></html>');
}
exit;
} elseif(!$authorize)
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'Вы не авторизованы! <br />
<a href="./?v=wml">Форумы ONY.SU</a> '.$tagC.'
</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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['text'].'"> '.$tag.'
Вы не авторизованны! '.$tagC.'
</td></tr>
<tr><td bgcolor="'.$style['bottom'].'"> '.$tag.'
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>'.$tagC.'
</td></tr>
</table>
</body></html>');
}
exit;
}
else
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype($q['username']).$tag);
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>'.$q['username'].'</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'].'" colspan="2">
<font color="#FFFFFF"><b>'.$q['username'].'</b></font>
</td></tr>
<tr><td bgcolor="'.$style['text'].'" colspan="2">'.$tag);
}
echo('Логин: '.$q['username'].' <br />');
if($status == "admin")
{
echo('Пароль: '.$q['password'].'<br />');
}
if(empty($q['name']) and empty($q['realname']) and empty($q['rdate']) and empty($q['icq']) and empty($q['site']) and empty($q['mail']) and $q['sex'] == "n" and empty($q['about']))
{
echo('Анкета не заполнена! <br />');
} else
{
echo(empty($q['realname']) ? '' : 'Настоящее имя: '.$q['realname'].'<br />');
if($q['sex'] == "m")
{
echo('Пол: М <br />');
} elseif($q['sex'] == "f")
{
echo('Пол: Ж <br />');
}
echo(empty($q['rdate']) ? '' : 'Дата рождения: '.$q['rdate'].'<br />');
echo(empty($q['icq']) ? '' : 'ICQ: '.$q['icq'].'<br />');
echo(empty($q['mail']) ? '' : 'E-mail: '.$q['mail'].'<br />');
echo(empty($q['site']) ? '' : 'Сайт: <a href="go/?http://'.$q['site'].'">'.$q['site'].'</a><br />');
echo(empty($q['about']) ? '' : 'О себе: '.$q['about'].'<br />');
}
}
if($version == "wml")
{
echo('Дата регистрации: '.date('d.m.Y H:s', $q['regdate']).' <br />
Последний раз появлялся: '.date('d.m.Y H:i:s', $q['last_time']).' <br />
Постов: '.mysql_result(mysql_query("SELECT COUNT(*) FROM `posts` WHERE `name`='".$q['username']."'"), 0).'<br />
Рейтинг: +'.$q['rating']."/-" . $q['antirating'] . "<br />
rn".$tagC);
if($status == "moderator" OR $status == "admin")
{
echo("Рейтинг:<br />rn");
echo("<select name="rat">rn");
echo("<option value="1">1</option>rn");
echo("<option value="2">2</option>rn");
echo("<option value="3">3</option>rn");
echo("<option value="5">5</option>rn");
echo("<option value="10">10</option>rn");
echo("<option value="15">15</option>rn");
echo("<option value="20">20</option>rn</select><br />rn");
echo("<anchor>[Добавить]rn
<go href="./?mode=user&id=".$id."&sid=".$sid."&v=wml" method="post">
<postfield name="rat" value="$(rat)" />
</go>
</anchor><br />rn");
echo("Антирейтинг: <br />rn" .
"<select name='antirat'>rn" .
"<option value="1">1</option>rn" .
"<option value="2">2</option>rn" .
"<option value="3">3</option>rn" .
"<option value="5">5</option>rn" .
"<option value="10">10</option>rn" .
"<option value="15">15</option>rn" .
"<option value="20">20</option>rn" .
"</select><br />rn" .
"<anchor>[Добавить]rn" .
"<go href='./?mode=user&id=$id&sid=$sid&v=wml' method='post'>rn" .
"<postfield name='antirat' value='$(antirat)' />rn" .
"</go>rn" .
"</anchor><br />rn");
}
echo($tag.'
<a href="private.php?v=wml&sid='.$sid.'&uid='.$id.'&p=1">Написать в личку</a><br />');
if($status == "admin")
{
echo('<a href="admin.php?v=wml&sid='.$sid.'&mode=moder&m=1&id='.$id.'">В модеры</a><br />');
}
echo('<anchor>Назад<prev /></anchor>'.$tagC.'
</p></card></wml>');
} elseif($version == "xhtml")
{
echo('Дата регистрации: '.date("d.m.Y H:s", $q['regdate']).' <br />
Последний раз появлялся: '.date('d.m.Y H:i:s', $q['last_time']).' <br />
Постов: '.mysql_result(mysql_query("SELECT COUNT(*) FROM `posts` WHERE `name`='".$q['username']."'"), 0).'<br />
Рейтинг: +'.$q['rating'].'/-' . $q['antirating'] . '<br />
'.$tagC.'
</td></tr>');
if($status == "moderator" OR $status == "admin")
{
echo("<tr bgcolor='" . $style['bottom'] . "'><td>rn");
echo("<form action="./?mode=user&id=".$id."&sid=".$sid."&v=xhtml" method="post">rn");
echo("Рейтинг:<br />rn");
echo("<select name="rat">rn");
echo("<option value="1">1</option>rn");
echo("<option value="2">2</option>rn");
echo("<option value="3">3</option>rn");
echo("<option value="5">5</option>rn");
echo("<option value="10">10</option>rn");
echo("<option value="15" selected="1">15</option>rn");
echo("<option value="20">20</option>rn</select><br />rn");
echo("<input type="submit" value="Добавить" /><br />rn</form>rn");
echo("</td><td>");
echo("<form action="./?mode=user&id=".$id."&sid=".$sid."&v=xhtml" method="post">rn");
echo("Антирейтинг:<br />rn");
echo("<select name="antirat">rn");
echo("<option value="1">1</option>rn");
echo("<option value="2">2</option>rn");
echo("<option value="3">3</option>rn");
echo("<option value="5">5</option>rn");
echo("<option value="10">10</option>rn");
echo("<option value="15" selected="1">15</option>rn");
echo("<option value="20">20</option>rn</select><br />rn");
echo("<input type="submit" value="Добавить" /><br />rn</form>rn");
echo("</td></tr>");
}
echo($tag);
echo('<tr><td bgcolor="'.$style['bottom'].'" colspan="2">');
if($status == "admin" and $q['username'] != $username)
{
echo('<a href="admin.php?v=xhtml&sid='.$sid.'&mode=moder&m=1&id='.$id.'">В модеры</a><br />');
}
echo('<a href="private.php?v=xhtml&sid='.$sid.'&uid='.$id.'&p=1">Написать в личку</a><br />
<a href="javascript:history.back()">Назад</a>'.$tagC.'
</td></tr></table>
</body></html>');
}
break;
case 'ans':
$f = intval($_GET['f']);
if($status == "admin") $ip = "127.0.0.1"; else $ip = empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR'] ;
$ip = htmlspecialchars(sql($ip));
if($status == "admin") $user = "Admin"; else $user = htmlspecialchars(sql($_SERVER['HTTP_USER_AGENT']));
$query = mysql_query("SELECT themes.*, forums.name AS fname
FROM themes, forums
WHERE themes.id=".$f."
AND themes.id_forum=forums.id");
$data = mysql_fetch_assoc($query);
if(mysql_num_rows($query) < 1)
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'
Темы не существует! <br />
-
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a> '.$tagC.'
</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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['text'].'">'.$tag.'
Темы не существует!
'.$tagC.'</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">'.$tag.'
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</td></tr></table>
</body></html>');
}
} elseif($data['close'] == "on")
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'
Темы закрыта! <br />
<anchor>Назад<prev /></anchor><br />
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'
</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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['text'].'">'.$tag.'
Тема закрыта!
'.$tagC.'</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">'.$tag.'
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</td></tr></table>
</body></html>');
}
}
elseif(!$authorize)
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'
Вы не авторизованы! <br />
<anchor>Назад<prev /></anchor><br />
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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['text'].'">'.$tag.'
Вы не авторизованы!
'.$tagC.'</td></tr>
<tr><td bgcolor="'.$style['bottom'].'">'.$tag.'
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</td></tr>
</table>
</body></html>');
}
}
elseif(ban($username, $user, $ip))
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'
Ошибка! Вы заблокированы модератором '.$modername.'. <br />
Причина: '.$banmess.'! <br />
-
<a href="'.$_SERVER['HTTP_REFERER'].'">Назад</a><br />
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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 align="center" bgcolor="'.$style['title'].'"><td colspan="2">
<font color="#FFFFFF"><b>Ошибка</b></font>
<tr bgcolor="'.$style['text'].'"><td colspan="2">'.$tag.'Вы заблокированы модератором '.$modername.'</td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Причина:'.$tagC.'</td><td>'.$tag.$banmess.$tagC.'</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</td></tr></table>
</body></html>');
}
}
else
{
if(empty($_POST['ans']))
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ответить").$tag.'
Логин ['.$username.']
<br />
Тема ['.$data['tname'].'] <br />
Сообщение: <br />'.$tagC.'
<input type="text" name="mess'.$ref.'" maxlength="600" /><br />');
if(is_author($f, $username) or $status == "moder" or $status == "admin")
{
echo($tag.'Закрыть тему:'.$tagC.'<br />
<select name="closed'.$ref.'" value="0">
<option value="0">Нет</option>
<option value="1">Да</option>
</select><br />');
}
echo('<anchor>[Ответить]
<go href="./?v=wml&sid='.$sid.'&mode=ans&f='.$f.'" method="post">
<postfield name="mess" value="$(mess'.$ref.')" />');
if(is_author($f, $username) or $status == "moderator" or $status == "admin")
{
echo('<postfield name="closed" value="$(closed'.$ref.')" />');
}
echo('<postfield name="ans" value="true" />
</go></anchor><br />'.$tag.'
<a href="./?v=wml&mode=help&sid='.$sid.'&f=4">Смайлы</a><br />
<a href="./?v=wml&mode=posts&sid='.$sid.'&p='.$f.'">В тему</a><br />
<a href="./?v=wml&mode=topics&sid='.$sid.'&f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ответить</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<form action="'.$forumdir.'v=xhtml&sid='.$sid.'&mode=ans&f='.$f.'" method="post">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
<font color="#FFFFFF"><b>Ответить</b></font>
</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2"></td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Имя:'.$tagC.'</td><td>'.$tag.'['.$username.']'.$tagC.'</td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Тема:'.$tagC.'</td><td>'.$tag.'[Re: '.$data['tname'].']'.$tagC.'</td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Сообщение:'.$tagC.'</td><td><textarea name="mess" cols="30" rows="5"></textarea></td></tr>');
if(is_author($f, $username) or $status == "moderator" or $status == "admin")
{
echo('<tr bgcolor="'.$style['text'].'"><td nowrap>'.$tag.'Закрыть тему:'.$tagC.'</td>
<td><select name="closed">
<option value="0">Нет</option>
<option value="1">Да</option>
</select></td></tr>');
}
echo('
<tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
<input type="hidden" name="ans" value="true">
<input type="submit" value="Ответить" /></td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
<a href="./?v=xhtml&mode=help&sid='.$sid.'&f=4">Смайлы</a><br />
<a href="./?v=xhtml&mode=posts&sid='.$sid.'&p='.$f.'">В тему</a><br />
<a href="./?v=xhtml&mode=topics&sid='.$sid.'&f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</td></tr></table>
</form>
</body></html>');
}
} else
{
$message = $_POST['mess'];
if($transl == "on")
{
$message = translate($message);
}
$message = sql(htmlspecialchars(trim(chop(substr($message, 0, 500)))));
$message = preg_replace_callback("|<(d{1,20})>|", "smile", $message);
if($status == "admin" or $starus == "moderator")
{
$message= preg_replace("|[b](.*)[/b]|i", "<b>\1</b>", $message);
$message = preg_replace("|[i](.*)[/i]|i", "<i>\1</i>", $message);
}
if(strpos($message, "http://") !== false)
{
$message = preg_replace("|(http://[^s]+)|i", "<a href="go/?\1">\1</a>", $message);
}
else
{
$message = preg_replace("|[url=(.*)](.*)[/url]|is", "<a href="go/?http://\1">\2</a>", $message);
}
if(!preg_match("|^[-a-z0-9а-яё_!?№#;:%^&*()+=~|\/ @.,[]{}"'<>s]*$|iu", $message) or empty($message))
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ответить").$tag.'
<b>Поле "Сообщение" пустое или содержит плохие символы! </b><br />
Имя: ['.$username.'] <br />
Тема: ['.$data['tname'].'] <br />
Сообщение: '.$tagC.'<br />
<input type="text" name="mess'.$ref.'" maxlength="600" /><br />');
if(is_author($f, $username) or $status == "moderator" or $status == "admin")
{
echo($tag.'Закрыть тему:'.$tagC.'<br />
<select name="closed'.$ref.'" value="0">
<option value="0">Нет</option>
<option value="1">Да</option>
</select><br />');
}
echo('
<anchor>[Ответить]
<go href="./?v=wml&sid='.$sid.'&mode=ans&f='.$f.'" method="post">
<postfield name="mess" value="$(mess'.$ref.')" />');
if(is_author($f, $username) or $status == "moderator" or $status == "admin")
{
echo('<postfield name="closed" value="$(closed'.$ref.')" />');
}
echo('
<postfield name="ans" value="true" />
</go></anchor><br />
'.$tag.'
<a href="./?v=wml&mode=help&sid='.$sid.'&f=4">Смайлы</a><br />
<a href="./?v=wml&mode=posts&sid='.$sid.'&p='.$f.'">В тему</a><br />
<a href="./?v=wml&mode=topics&sid='.$sid.'&f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ответить</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<form action="'.$forumdir.'v=xhtml&sid='.$sid.'&mode=ans&f='.$f.'" method="post">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
<font color="#FFFFFF"><b>Ответить</b></font>
</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2"></td></tr>
<tr bgcolor="#deebf1"><td colspan="2">'.$tag.'<b>Ошибка!!! Поле "Сообщение" пустое или содержит плохие символы!</b>'.$tagC.'</td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Имя:'.$tagC.'</td><td>'.$tag.'['.$username.']'.$tagC.'</td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Тема:'.$tagC.'</td><td>'.$tag.'[Re: '.$data['tname'].']'.$tagC.'</td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Сообщение:'.$tagC.'</td><td><textarea name="mess" cols="30" rows="5"></textarea></td></tr>');
if(is_author($f, $username) or $status == "moderator" or $status == "admin")
{
echo('<tr bgcolor="'.$style['text'].'"><td nowrap>Закрыть тему:</td>
<td><select name="closed">
<option value="0">Нет</option>
<option value="1">Да</option>
</select></td></tr>');
}
echo('
<tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
<input type="hidden" name="ans" value="true">
<input type="submit" value="Ответить" /></td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
<a href="./?v=xhtml&mode=help&sid='.$sid.'&f=4">Смайлы</a><br />
<a href="./?v=xhtml&mode=posts&sid='.$sid.'&p='.$f.'">В тему</a><br />
<a href="./?v=xhtml&mode=topics&sid='.$sid.'&f='.$data['id_forum'].'">В «'.$data['fname'].'»</a><br />
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</td></tr></table>
</form>
</body></html>');
}
} else
{
if(mysql_result(
mysql_query("SELECT COUNT(*)
FROM `posts`
WHERE `name` = '$username'
AND `id_theme` = ".$f."
AND `crc32` = ".crc32($message)), 0))
{
header("Location: ".$forumdir."f=".$data['id_forum']."&v=".$version."&mode=topics&sid=".$sid);
exit();
}
if(($status == "admin" or $status == "moderator" or is_author($f, $username)) and $_POST['closed'] == "1")
{
mysql_query("UPDATE `themes`
SET `close`='on' WHERE `id`=".$f);
}
mysql_query("INSERT INTO `posts` VALUES(0, '".$username."', '".$message."', ".crc32($message).", ".$f.", ".time().", '".$user."', '".$ip."')");
header("Location: ".$forumdir."f=".$data['id_forum']."&v=".$version."&mode=topics&sid=".$sid);
}
}
}
break;
case 'newt':
$f = intval($_GET['f']);
@$back = mysql_fetch_assoc(mysql_query("SELECT name, id FROM `forums` WHERE id=".$f));
$ip = empty($_SERVER['HTTP_X_FORWARDED_FOR']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR'] ;
$ip = htmlspecialchars(addslashes($ip));
if($status == "admin") $user = "Admin"; else $user = htmlspecialchars(sql($_SERVER['HTTP_USER_AGENT']));
if(!mysql_result(mysql_query("SELECT COUNT(*) FROM forums WHERE id=".$f), 0))
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'
Ошибка! Подфорума не существует! <br />
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Ошибка! Подфорума не существует! '.$tagC.' </td></tr>
<tr bgcolor="'.$style['bottom'].'"><td>'.$tag.'
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</td></tr></table>
</body></html>');
}
} elseif(ban($username, $user, $ip))
{
if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'
Ошибка! Вы заблокированы модератором '.$modername.'. <br />
Причина: '.$banmess.'! <br />
-
<a href="'.$_SERVER['HTTP_REFERER'].'">Назад</a><br />
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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 align="center" bgcolor="'.$style['title'].'"><td colspan="2">
<font color="#FFFFFF"><b>Ошибка</b></font>
<tr bgcolor="'.$style['text'].'"><td colspan="2">'.$tag.'Вы заблокированы модератором '.$modername.'</td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Причина:'.$tagC.'</td><td>'.$tag.$banmess.$tagC.'</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</td></tr></table>
</body></html>');
}
} elseif(!$authorize)
{ if($version == "wml")
{
header('Content-type: text/vnd.wap.wml; charset=utf-8');
echo(doctype("Ошибка").$tag.'
Вы не авторизованы! <br />
-
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Ошибка</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 align="center" bgcolor="'.$style['title'].'"><td>
<font color="#FFFFFF"><b>Ошибка</b></font>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Вы не авторизованы!'.$tagC.'</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td> '.$tag.'
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</td></tr></table>
</body></html>');
}
} else
{
if(empty($_POST['nt']))
{
$r = "";
for($i=0; $i<strlen($username); $i++)
{
$r .= "_";
}
if($version == "wml")
{
header("Content-type: text/vnd.wap.wml; charset=utf-8");
echo(doctype("Новая тема").$tag.'
Имя: ['.$username.']<br />
Тема: '.$tagC.'<br />
<input type="text" name="topic'.$ref.'" /><br />
'.$tag.'Сообщение:'.$tagC.' <br />
<input type="text" name="mess'.$ref.'" maxlength="600" /><br />');
if($status == "moder" or $status == "admin")
{
echo($tag.'Закрепить тему: '.$tagC.'<br />
<select name="b'.$ref.'">
<option value="0">Нет</option>
<option value="1">Да</option>
</select><br />');
}
echo('<anchor>[Добавить]
<go href="./?v=wml&sid='.$sid.'&mode=newt&f='.$f.'" method="post">
<postfield name="mess" value="$(mess'.$ref.')" />');
if($status == "moderator" or $status == "admin")
{
echo('<postfield name="b" value="$(b'.$ref.')" />');
}
echo('
<postfield name="topic" value="$(topic'.$ref.')" />
<postfield name="nt" value="1" />
</go></anchor><br />
'.$tag.'-
<a href="./?v=wml&mode=help&sid='.$sid.'&f=4">Смайлы</a><br />
<a href="./?v=wml&mode=topics&sid='.$sid.'&f='.$f.'">В «'.$back['name'].'»</a><br />
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Новая тема</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<form action="'.$forumdir.'v=xhtml&sid='.$sid.'&mode=newt&f='.$f.'" method="post">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
<font color="#FFFFFF"><b>Новая тема</b></font>
</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2"></td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Имя:'.$tagC.'</td><td>'.$tag.'['.$username.']'.$tagC.'</td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Тема:'.$tagC.'</td><td><input type="text" name="topic"></td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Сообщение:'.$tagC.'</td><td><textarea name="mess" cols="30" rows="5"></textarea></td></tr>');
if($status == "moderator" or $status == "admin")
{
echo('<tr bgcolor="'.$style['text'].'"><td nowrap>'.$tag.'Закрепить тему:'.$tagC.'</td>
<td><select name="b">
<option value="0">Нет</option>
<option value="1">Да</option>
</select></td></tr>');
}
echo('
<tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
<input type="hidden" name="nt" value="1">
<input type="submit" value="Ответить" /></td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2"> '.$tag.'
<a href="./?v=xhtml&mode=help&sid='.$sid.'&f=4">Смайлы</a><br />
<a href="./?v=xhtml&mode=topics&sid='.$sid.'&f='.$back['id'].'">В «'.$back['name'].'»</a><br />
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</td></tr></table>
</form>
</body></html>');
}
} else
{
$error = "";
$topic = $_POST['topic'];
if($transl == "on")
{
$topic = translate($topic);
}
$topic = sql(trim(htmlspecialchars(chop($topic))));
$topic = substr($topic, 0, 40);
$topic = preg_replace("|[rn]+|", "rn", $topic);
$topic = preg_replace("|[n]+|", "n", $topic);
$message = $_POST['mess'];
if($transl == "on")
{
$message = translate($message);
}
$message = sql(htmlspecialchars(trim(chop(substr($message, 0, 500)))));
$message = preg_replace_callback("|<(d{1,20})>|", "smile", $message);
if($status == "admin" or $starus == "moderator")
{
$message= preg_replace("|[b](.*)[/b]|i", "<b>\1</b>", $message);
$message = preg_replace("|[i](.*)[/i]|i", "<i>\1</i>", $message);
}
if(strpos($message, "http://") !== false)
{
$message = preg_replace("|(http://[^s]+)|i", "<a href="go/?\1">\1</a>", $message);
}
else
{
$message = preg_replace("|[url=(.*)](.*)[/url]|is", "<a href="go/?http://\1">\2</a>", $message);
}
if(empty($message))
{
$error .= "Поле "Сообщение" не заполнено! <br />";
}
if(empty($topic))
{
$error .= "Поле "Тема" не заполнено! <br />";
}
if(!preg_match("|^[-a-z0-9а-яё_!?№#;:%^&*()+=~|\/ @.,[]{}"'<>s]*$|iu", $message))
{
$error .= "Сообщение содержит плохие символы!<br />";
}
if(!preg_match("|^[-a-z0-9а-яё_!?№#;:%^&*()+=~|\/ @.,[]{}"'<>]*$|iu", $topic))
{
$error .= "Тема содержит плохие символы!<br />";
}
if(!empty($error))
{
$r = "";
for($i=0; $i<strlen($username); $i++)
{
$r .= "_";
}
if($version == "wml")
{
header("Content-type: text/vnd.wap.wml; charset=utf-8");
echo(doctype("Новая тема").$tag.$error.'
Имя: ['.$username.']<br />
Тема:'.$tagC.' <br />
<input type="text" name="topic'.$ref.'" /><br />
'.$tag.'Сообщение:'.$tagC.' <br />
<input type="text" name="mess'.$ref.'" maxlength="600" /><br />');
if($status == "moderator" or $status == "admin")
{
echo($tag.'Закрепить тему: '.$tagC.'<br />
<select name="b'.$ref.'">
<option value="0">Нет</option>
<option value="1">Да</option>
</select><br />');
}
echo('
<anchor>[Ответить]
<go href="./?v=wml&sid='.$sid.'&mode=newt&f='.$f.'" method="post">
<postfield name="mess" value="$(mess'.$ref.')" /> ');
if($status == "moder" or $status == "admin")
{
echo('<postfield name="b" value="$(b'.$ref.')" />');
}
echo('
<postfield name="topic" value="$(topic'.$ref.')" />
<postfield name="nt" value="1" />
</go></anchor><br />
'.$tag.'-
<a href="./?v=wml&mode=help&sid='.$sid.'&f=4">Смайлы</a><br />
<a href="./?v=wml&mode=topics&sid='.$sid.'&f='.$f.'">В «'.$back['name'].'»</a><br />
<a href="./?v=wml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'</p></card></wml>');
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Новая тема</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<form action="'.$forumdir.'v=xhtml&sid='.$sid.'&mode=newt&f='.$f.'" method="post">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr><td align="center" bgcolor="'.$style['title'].'" colspan="2">
<font color="#FFFFFF"><b>Новая тема</b></font>
</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2"></td></tr>
<tr bgcolor="#deebf1"><td colspan="2">'.$tag.'<b>'.$error.'</b>'.$tagC.'</td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Имя:'.$tagC.'</td><td>'.$tag.'['.$username.']'.$tagC.'</td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Тема:'.$tagC.'</td><td><input type="text" name="topic"></td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag.'Сообщение:'.$tagC.'</td><td><textarea name="mess" cols="30" rows="5"></textarea></td></tr>');
if($status == "moderator" or $status == "admin")
{
echo('<tr bgcolor="'.$style['text'].'"><td nowrap>'.$tag.'Закрепить тему:'.$tagC.'</td>
<td><select name="b">
<option value="0">Нет</option>
<option value="1">Да</option>
</select></td></tr>');
}
echo('
<tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
<input type="hidden" name="nt" value="1">
<input type="submit" value="Ответить" /></td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
<a href="./?v=xhtml&mode=help&sid='.$sid.'&f=4">Смайлы</a><br />
<a href="./?v=xhtml&mode=topics&sid='.$sid.'&f='.$back['id'].'">В «'.$back['name'].'»</a><br />
<a href="./?v=xhtml&sid='.$sid.'">Форумы ONY.SU</a>
'.$tagC.'
</td></tr>
</table>
</form>
</body></html>');
}
} else
{
if(mysql_result(
mysql_query("SELECT COUNT(*)
FROM `themes`
WHERE `tname` = '".$topic."'
AND `name` = '".$username."'"), 0))
{
header("Location: ".$forumdir."v=".$version."&mode=topics&f=".$f."&sid=".$sid);
exit();
}
if(($status == "moderator" or $status == "admin") and $_POST['b'] == "1")
{
$SQL = "INSERT INTO `themes` VALUES(0, '".$topic."', '".$username."', 'off', ".$f.", ".time().", 0, 0, '')";
} else
{
$SQL = "INSERT INTO `themes` VALUES(0, '".$topic."', '".$username."', 'off', ".$f.", ".time().", 1, 0, '')";
}
mysql_query($SQL);
mysql_query("INSERT INTO `posts` VALUES (0, '".$username."', '".$message."', ".crc32($message).", '".mysql_insert_id()."', '".time()."', '".$user."', '".$ip."')");
header("Location: ".$forumdir."v=".$version."&mode=topics&f=".$f."&sid=".$sid);
}
}
}
break;
case 'help':
if($version == "wml")
{
header("Content-type: text/vnd.wap.wml; charset=utf-8");
echo(doctype("Помощь").$tag);
}
elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Помощь</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 align="center" bgcolor="'.$style['title'].'"><td colspan="2">
<font color="#FFFFFF"><b>Помощь</b></font>
</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td></td></tr>
<tr bgcolor="'.$style['text'].'"><td>'.$tag);
}
if($_GET['f'] == 1)
{
echo('<b>На форуме запрещено:</b><br />
1. Оскарбление модераторов, пользователей и создателей форума. <br />
2. Пропаганда насилия, националистических и политических лозунгов, извращений, преднамеренное создание конфликтных ситуаций.<br />
3. Плагиат (клонирование) ников.<br />
4. Многократное повторение сообщений, не несущих в себе смысловой нагрузки.<br />
5. Размещение сообщений, не соответствующих тематике подфорума.<br />
<br />
В случае нарушения правил форума модераторы имеет право блокировать Вас!<br />');
} elseif($_GET['f'] == 2)
{
echo('<b>Правила для модераторов:</b><br />
Модератор обязан: <br />
1. Служить примером для других пользователей форума.<br />
2. Следить за порядком на форуме. <br />
3. Блокировать пользователя при нарушении правил. <br />
4. Удалять, либо перемещать темы не соответствующие подфоруму. <br />
5. Закрывать темы, выходящие за рамки своего контекста. <br />
6. Закрывать темы, перерастающие в конфликтные ситуации.<br />
<br />
Модератор не обязан: <br />
1. Все время находится на форуме.<br />
2. Отчитываться за свои действия перед другими пользователями форума. Он может сделать это по своему усмотрению.<br />
<br />
Модераторам запрещено: <br />
1. Участие в конфликтах на форуме.<br />
2. Передача своего пароля либо SID-a со своей авторизацией другим пользователям.<br />
3. Разглашение служебной информации.<br />
4. Использование своего статуса в личных целях.<br />
<br />
За не соблюдение вышеперечисленных правил должность модератора будет снята!<br />');
} elseif($_GET['f'] == 3)
{
echo('Правила транслита: <br />
'.nl2br('А а - A a
Б б - B b
В в - V v
Г г - G g
Д д - D d
Е е - E e
Ё ё - Yo yo (Jo jo)
Ж ж - Zh zh (*)
З з - Z z
И и - I i
Й й - Y y
К к - K k
Л л - L l
М м - M m
Н н - N n
О о - O o
П п - P p
Р р - R r
С с - S s
Т т - T t
У у - U u
Ф ф - F f
Х х - H h
Ц ц - C c
Ч ч - Ch ch
Ш ш - Sh sh (W w)
Щ щ - Shc shc
Ъ ъ - '' (два апострофа)
Ы ы - X x
Ь ь - Q q (')
Э э - Ye ye
Ю ю - Yu yu
Я я - Ya ya (Ja ja)
'));
} elseif($_GET['f'] == 4)
{
$arr = array('<1>',
'<2>',
'<3>',
'<4>',
'<5>',
'<6>',
'<7>',
'<8>',
'<9>',
'<10>',
'<11>',
'<12>',
'<13>',
'<14>',
'<15>',
'<16>',
'<17>',
'<18>',
'<19>',
'<20>',
'<21>',
'<22>',
'<23>',
'<24>',
'<25>',
'<26>',
'<27>',
'<28>',
'<29>',
'<30>',
'<31>',
'<32>',
'<33>',
'<34>',
'<35>',
'<36>',
'<37>',
'<38>'
);
$smiles = array(
"<img src='smiles/1.gif' />",
"<img src='smiles/2.gif' />",
"<img src='smiles/3.gif' />",
"<img src='smiles/4.gif' />",
"<img src='smiles/5.gif' />",
"<img src='smiles/6.gif' />",
"<img src='smiles/7.gif' />",
"<img src='smiles/8.gif' />",
"<img src='smiles/9.gif' />",
"<img src='smiles/10.gif' />",
"<img src='smiles/11.gif' />",
"<img src='smiles/12.gif' />",
"<img src='smiles/13.gif' />",
"<img src='smiles/14.gif' />",
"<img src='smiles/15.gif' />",
"<img src='smiles/16.gif' />",
"<img src='smiles/17.gif' />",
"<img src='smiles/18.gif' />",
"<img src='smiles/19.gif' />",
"<img src='smiles/20.gif' />",
"<img src='smiles/21.gif' />",
"<img src='smiles/22.gif' />",
"<img src='smiles/23.gif' />",
"<img src='smiles/24.gif' />",
"<img src='smiles/25.gif' />",
"<img src='smiles/26.gif' />",
"<img src='smiles/27.gif' />",
"<img src='smiles/28.gif' />",
"<img src='smiles/29.gif' />",
"<img src='smiles/30.gif' />",
"<img src='smiles/31.gif' />",
"<img src='smiles/32.gif' />",
"<img src='smiles/33.gif' />",
"<img src='smiles/34.gif' />",
"<img src='smiles/35.gif' />",
"<img src='smiles/36.gif' />",
"<img src='smiles/37.gif' />",
"<img src='smiles/38.gif' />"
);
echo("Вы можете вставить смайл в сообщение набрав в угловых скобках число от 1 до 38<br />rn");
echo '<img src="smiles/1.gif" alt=":-)"/><1>
<img src="smiles/2.gif" alt=":-("/><2> <br />
<img src="smiles/3.gif" alt=":-["/><3>
<img src="smiles/4.gif" alt="8-)"/><4> <br />
<img src="smiles/5.gif" alt=":-E)"/><5>
<img src="smiles/6.gif" alt=":-P"/><6> <br />
<img src="smiles/7.gif" alt="{beer}"/><7>
<img src="smiles/8.gif" alt="{tee}"/><8> <br />
<img src="smiles/9.gif" alt="{smoke}"/><9>
<img src="smiles/10.gif" alt="{vine}"/><10> <br />
<img src="smiles/11.gif" alt="{kiss}"/><11>
<img src="smiles/12.gif" alt="{heard}"/><12> <br />
<img src="smiles/13.gif" alt=""/><13>
<img src="smiles/14.gif" alt="{ok}"/><14> <br />
<img src="smiles/15.gif" alt="{no}"/><15>
<img src="smiles/16.gif" alt="{cool}"/><16> <br />
<img src="smiles/17.gif" alt="{flower}"/><17>
<img src="smiles/18.gif" alt="{cherry}"/><18> <br />
<img src="smiles/19.gif" alt="{ball}"/><19>
<img src="smiles/20.gif" alt="{surprise}"/><20> <br />';
echo '<a href="./?mode=help&v='.$version.'&sid='.$sid.'&f=6">Дальше...</a><br />';
} elseif($_GET['f'] == 6)
{
echo("Вы можете вставить смайл в сообщение набрав в угловых скобках число от 1 до 38<br />rn");
echo '<img src="smiles/21.gif" alt="{cake}"/><21>
<img src="smiles/22.gif" alt="{phone}"/><22> <br />
<img src="smiles/23.gif" alt="{mobile}"/><23>
<img src="smiles/24.gif" alt="{wall}"/><24> <br />
<img src="smiles/25.gif" alt="{camel}"/><25>
<img src="smiles/26.gif" alt="{cat}"/><26> <br />
<img src="smiles/27.gif" alt="{pig}"/><27>
<img src="smiles/28.gif" alt="{hammer}"/><28> <br />
<img src="smiles/29.gif" alt="{gun}"/><29>
<img src="smiles/30.gif" alt="{skull}"/><30> <br />
<img src="smiles/31.gif" alt="{rip}"/><31>
<img src="smiles/32.gif" alt="{sun}"/><32> <br />
<img src="smiles/33.gif" alt="{moon}"/><33>
<img src="smiles/34.gif" alt="{raketa}"/><34> <br />
<img src="smiles/35.gif" alt="{dollar}"/><35>
<img src="smiles/36.gif" alt="{fig}"/><36> <br />
<img src="smiles/37.gif" alt="{drug}"/><37>
<img src="smiles/38.gif" alt="{fuck}"/><38> <br />';
}
elseif($_GET['f'] == 5)
{
if($authorize)
{
$arr = array($username, $password);
}
else
{
$arr = array("Ваш_Логин", "Ваш_Пароль");
}
echo('Ссылка для автологина - '.str_replace("?", "", $forumdir).'/l/?'.$arr[0].':'.$arr[1]."<br />rn");
}
else
{
echo('<a href="./?mode=help&v='.$version.'&sid='.$sid.'&f=1">Правила форума</a><br />
<a href="./?mode=help&v='.$version.'&sid='.$sid.'&f=2">Правила для модераторов</a><br />
<a href="./?mode=help&v='.$version.'&sid='.$sid.'&f=3">Правила транслита</a><br />
<a href="./?mode=help&v='.$version.'&sid='.$sid.'&f=4">Смайлы</a><br />
<a href="./?mode=help&v='.$version.'&sid='.$sid.'&f=5">Автологин</a><br />
');
}
if($version == "wml")
{
echo('<anchor>Назад<prev /></anchor><br />
<a href="./?v=wml&sid='.$sid.'">В форум</a>
'.$tagC.'</p></card></wml>');
} elseif($version == "xhtml")
{
echo($tagC.'</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td>'.$tag.'
<a href="'.htmlspecialchars($_SERVER['HTTP_REFERER']).'">Назад</a><br />
<a href="./?v=xhtml&sid='.$sid.'">В форум</a>
'.$tagC.'</td></tr></table>
</body></html>');
}
break;
case 'exit':
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `session` WHERE sid='".$sid."'"), 0))
{
mysql_query("DELETE FROM `session` WHERE sid='".$sid."'");
}
header("Location: ".$forumdir."&v=".$version."&sid=".$sid);
break;
case 'reSort';
if($authorize)
{
if($order == 1)
{
$newOrder = 0;
}
else
{
$newOrder = 1;
}
mysql_query("UPDATE `users` SET `order`=".$newOrder." WHERE `username`='".$username."'");
}
header("Location: ".$forumdir."v=".$version."&mode=topics&f=".$_GET['f']."&sid=".$sid);
break;
case 'qt':
$p = intval($_GET['p']);
$c = intval($_GET['c']);
if($version == "wml")
{
header("Content-type: text/vnd.wap.wml; charset=utf-8");
echo(doctype("Перейти к[1-".$c."]").$tag);
echo("Читать с[1-".$c."]:".$tagC."<input type="text" name="ss" size="5" format="*N" /><br />rn");
echo($tag."<a accesskey="1" href="./?v=wml&mode=posts&s=$(ss)&sid=".$sid."&p=".$p."">Перейти (1)</a><br />rn");
echo("<a accesskey="2" href="./?v=wml&mode=posts&sid=".$sid."&p=".$p."">Назад (2)</a>rn");
echo($tagC."</p></card></wml>");
} elseif($version == "xhtml")
{
header("Content-type: text/html; charset=utf-8");
echo('<html>
<head>
<title>Перейти к[1-'.$c.']</title>
</head>
<body bgcolor="'.$style['background'].'" link="'.$style['link'].'" vlink="'.$style['link'].'" text="#000000">
<form action="/forum/?v=xhtml&mode=posts&sid='.$sid.'&p='.$p.'" method="get">
<table align="center" border="0" cellspacing="1" cellpadding="5" width="350">
<tr align="center" bgcolor="'.$style['title'].'"><td colspan="2">
<font color="#FFFFFF"><b>Перейти к[1-'.$c.']</b></font>
</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">
<tr bgcolor="'.$style['text'].'">
<td>'.$tag.'Читать с[1-'.$c.']:'.$tagC.'</td><td><input type="text" name="ss" size="5" format="*N" /></td></tr>
<tr bgcolor="'.$style['text'].'"><td align="center" colspan="2">
<input type="hidden" name="p" value="'.$p.'" />
<input type="hidden" name="mode" value="posts" />
<input type="hidden" name="sid" value="'.$sid.'" />
<input type="hidden" name="v" value="xhtml" />
<input type="submit" value="Перейти" />
</td></tr>
<tr bgcolor="'.$style['bottom'].'"><td colspan="2">'.$tag.'
<a href="./?v=xhtml&mode=posts&sid='.$sid.'&p='.$p.'">Назад</a>
'.$tagC.'</td></tr>
</table>
</form>
</body></html>');
}
break;
}
list($msec,$sec)=explode(chr(32),microtime());
echo("rn<!--".round(($sec+$msec)-$headtime,4)."-->");
?>