Просмотр файла head.php

Размер файла: 2.24Kb
<? $starttime=microtime(1); include("bd.php"); require "auth.php";
if(isset($_SESSION['user_id']))$me=mysql_fetch_array(mysql_query("SELECT * FROM `sh_user` WHERE id=$_SESSION[user_id]"));
function code($text){
$text=htmlspecialchars($text);
$text=stripslashes($text);
$text=str_replace("\r\n","<br> ",$text);
$text=str_replace("\n",'<br/> ',$text);
$text = preg_replace('#\[big\](.*?)\[/big\]#si', '<big>\1</big>', $text);
$text = preg_replace('#\[b\](.*?)\[/b\]#si', '<b>\1</b>', $text);
$text = preg_replace('#\[i\](.*?)\[/i\]#si', '<i>\1</i>', $text);
$text = preg_replace('#\[u\](.*?)\[/u\]#si', '<u>\1</u>', $text);
$text = preg_replace('#\[small\](.*?)\[/small\]#si', '<small>\1</small>', $text);
$text = preg_replace('#\[color:(.*?)\](.*?)\[/color\]#si', '<font color="\1">\2</font>', $text);
$text = preg_replace('#\[url=(.*?)\](.*?)\[/url\]#si', '<a href="\1">\2</a>', $text);
$text = mysql_real_escape_string(trim($text));
return $text;}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FORUM.r1v.RU</title>
<? if(!isset($dir))echo '<link href="style.css" rel="stylesheet" type="text/css" />';
else echo '<link href="../style.css" rel="stylesheet" type="text/css" />';
?>
</head>
<body>


<div class="header">FO<font color="#000000">RU</font>M.R1V.RU<br>

</div>
<div class="rekl">
<a href="http://a.com">Реклама</a><br>
</div>
<?
if(isset($me)){$mails=mysql_num_rows(mysql_query("SELECT * FROM `sh_ls` WHERE `to`='$me[login]' AND `chit`='0'"));
if($mails!=0)echo "<img src='images/mail.gif'><a href='mail.php'>Личная почта</a>(".$mails.")<br/>";
$date=date("ndHis"); 
mysql_query ("UPDATE `sh_user` SET `time`='$date'  WHERE `id`='$me[id]' LIMIT 1");
}


else
{$date=date("ndHis");
if(mysql_num_rows(mysql_query("SELECT * FROM `sh_online` WHERE `ip`='$_SERVER[REMOTE_ADDR]'"))==0 )mysql_query("INSERT INTO `sh_online`
SET `ip`='$_SERVER[REMOTE_ADDR]',`ua`='$_SERVER[HTTP_USER_AGENT]', `time`='$date'");
else mysql_query("UPDATE `sh_online` SET `time`='$date' WHERE `ip`='$_SERVER[REMOTE_ADDR]'");
}


?>