Просмотр файла znak/h_f/html.php

Размер файла: 2.32Kb
<?php
# Автор: SoluS_Angelu[S] #
# ICQ: 865991 #
# Сайт: http://nkat.h2m.ru #

session_start();

if(isset($_COOKIE['id']) && isset($_COOKIE['pass']))
{
$id = $_COOKIE['id'];
$pass = $_COOKIE['pass'];

$q = mysql_query('SELECT * FROM users WHERE id = "'.$id.'" AND pass = "'.$pass.'" LIMIT 1');

if(mysql_num_rows($q) == 0)
{
$SES = false;
unset($_COOKIE['id'], $_COOKIE['pass']);
}
else
{
$SES = true;
$res = mysql_fetch_assoc($q);
}
}
else $SES = false;
################
if($SES)
{
mysql_query('UPDATE users SET online_time = "'.(time()+60).'" WHERE id = "'.$res['id'].'"');
}
################
function head()
{
$html='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><meta name="description" content=""/><meta name="keywords" content=""/>
<style type="text/css">
body { font-family: Arial,Tahoma; font-size: 12px; color: #008000; padding: 0px; margin: 0px; }
a { color: #228B22; text-decoration: none; }
.head { border-bottom: solid 2px #32CD32; padding: 2px; margin: 0px; }
.menu {
background-color: #e2e2e2; 
color: #6b6b6b;
text-shadow: 0 0 2px #8e8e8e;
text-align: left; 
border: 1px solid #c7c7c7;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
margin: 1px;
padding: 2px;
padding-left: 5px;
}
</style>
<title>By AngeluS</title>
</head><body>
<div class="header"><img src="images/logo.gif" alt="LoGo" /></div>
<div class="nav">
<a href="users.php">Юзеры</a> | <a href="feedback.php">Отзывы</a> | <a href="index.php">Главная</a></div>';

return $html;
}
################
if($SES)
{
$new_mess = mysql_result(mysql_query('SELECT COUNT(*) FROM mail WHERE mail_for = "'.$res['id'].'"'), 0);
if($new_mess > 0)
{
echo '<div class="menu">
<a href="mail.php"><font  color="red"><b>Вам почта: '.$new_mess.'</font></a></div>';
}
}
################
function foot()
{
$online = mysql_result(mysql_query('SELECT COUNT(*) FROM users WHERE online_time > "'.time().'"'
), 0);

$down='<div class="rekl">Общаются: <b>'.$online.'</b></div>
<div class="footer">&copy; by <a href="http://nkat.h2m.ru">SoluS_Angelu[S]</a> :: ICQ: 865991</div>
</body></html>';

return $down;
}
################
$chat = 1; // стоимость сообщения в чате
$advm = 5; // стоимость одного объявления
?>