Файл: NskriptS.zip/index.php
Строк: 158
<?php
list($msec, $sec) = explode(chr(32), microtime());
$headtime = $sec + $msec;
if($_GET['url']) {$url=stripslashes(strip_tags($_GET['url']));} else {$url='n.chatos.ru';}
error_reporting(0);
include("config.php");
include("./includes/constants/index");
include("./includes/".$ver."/banned");
$q = mysql_query("SELECT COUNT(*) FROM `chat_users`;");
$users = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(*) FROM `chat`;");
$posts = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `kick` > ".time().";");
$kicks = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(*) FROM `chat_banned`;");
$banned = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `fsize` = 0;");
$small_fsize = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `fsize` = 1;");
$medium_fsize = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `fsize` = 2;");
$big_fsize = mysql_result($q, 0);
$small_fsize = sprintf("%01.1f%s", $small_fsize/$users * 100, "%");
$medium_fsize = sprintf("%01.1f%s", $medium_fsize/$users * 100, "%");
$big_fsize = sprintf("%01.1f%s", $big_fsize/$users * 100, "%");
$q = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `security` = 0;");
$off_security = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `security` = 1;");
$on_security = mysql_result($q, 0);
$off_security = sprintf("%01.1f%s", $off_security/$users * 100, "%");
$on_security = sprintf("%01.1f%s", $on_security/$users * 100, "%");
$q = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `smiles` = 0;");
$smiles_on = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(*) FROM `chat_users` WHERE `smiles` != 0;");
$smiles_off = mysql_result($q, 0);
$smiles_on = sprintf("%01.1f%s", $smiles_on/$users * 100, "%");
$smiles_off = sprintf("%01.1f%s", $smiles_off/$users * 100, "%");
$nocache = rand(1000, 9999);
switch($ver)
{
case 'wml':
///////////////////////////////////////////////////////
//WML VERSION
///////////////////////////////////////////////////////
header("Content-type: text/vnd.wap.wml; charset=utf-8");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-cache, must-relative");
echo "<?xml version="1.0" encoding="UTF-8"?>n";
echo "<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">n<wml>n";
$chat = file("chat.dat");
$logo = trim($chat[0]);
$message = trim($chat[1]);
$q = mysql_query("SELECT COUNT(`id`) FROM `chat_users` WHERE `time` >= ".time().";");
$online = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(`id`) FROM `chat_users`;");
$users = mysql_result($q, 0);
echo "<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>n";
echo "<card id="index" title="".TITLE.""><p align="center">n";
echo "В чате: <a href="inchat.php?ver=wml">$online</a> человек<br/>";
echo "Логин:<br/>";
echo "<input type="text" name="nickname$nocache" maxlength="15"/><br/>";
echo "Пароль:<br/>";
echo "<input type="password" name="password$nocache" maxlength="20"/><br/>";
echo "<anchor>[Вход]<go href="menu.php?ver=wml&nocache=$nocache" method="post">";
echo "<postfield name="nickname" value="$(nickname$nocache)"/>";
echo "<postfield name="password" value="$(password$nocache)"/>";
echo "<postfield name="action" value="auth"/>";
echo "</go></anchor><br/>";
print "* * *<br/>";
echo "<a href="rules.php?ver=wml&action=registration">Регистрироваться</a><br/>";
echo "* * *<br/>";
echo REG_USERS.": <b><a href="index.php">$users</a></b><br/>";
print "* * *<br/>";
echo "<a href="http://netka.su">".MAIN."</a><br/>";
echo "<br />n";
list($msec, $sec) = explode(chr(32), microtime());
echo "<small>[".round(($sec + $msec) - $headtime, 5)."]</small><br/>n";
echo "</p></card></wml>";
break;
case 'html':
///////////////////////////////////////////////////////
//HTML VERSION
///////////////////////////////////////////////////////
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 "<?xml version="1.0" encoding="UTF-8"?>n";
echo "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">n";
echo "<html><head>n";
echo "<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />n";
echo '<link href="css.css" rel="stylesheet" type="text/css"><title>ЧАТ</title>
</head>
<body>';
$chat = file("chat.dat");
$logo = trim($chat[0]);
$message = trim($chat[1]);
$q = mysql_query("SELECT COUNT(`id`) FROM `chat_users` WHERE `time` >= ".time().";");
$online = mysql_result($q, 0);
$q = mysql_query("SELECT COUNT(`id`) FROM `chat_users`;");
$users = mysql_result($q, 0);
print "<div class="lic3"><img src="/images/chat.png"/><br/><b></b></div>Тусовка в чате на Netka.Su!<div class="lic">";
echo "В чате $online </a> человек</div>";
print "<div class="lic2"><img src="key.png"/>Войти в чат</div>";
echo "<div class="lic2">";
echo "<form action="menu.php?ver=html&nocache=$nocache" method="post">n";
echo "Ник:<br/>n";
echo "<input type="text" name="nickname" maxlength="15" />n";
echo "<br/>Транслит:<input type="checkbox" name="translit" value="yes" /><br/>n";
echo "Пароль:<br/>n";
echo "<input type="text" name="password" maxlength="20" /><br/>n";
echo "<input type="hidden" name="action" value="auth" />n";
echo "<input type="submit" class="ibutton" value="Войти" /></form>";
echo "</div><div class="lic">";
echo "<img src="m.png"/><a href="rules.php?ver=html&action=registration">Регистрация</a><br/>n";
echo "</div><div class="lic">";
echo "<img src="group.png"/>Регистраций: $users<br/>";
echo "<img src="/chat/homes.gif"/><a href="http://netka.su">Главная сайта</a><br/>n";
print '<a href="http://netka.su"><img src="http://wap-top.ru/top/count.php?uid=9545" alt=""/></a>';
break;
}
?>