View file include/1.php

File size: 3.9Kb
<? $starttime=microtime(1); include "bd.php";require "avto.php";
if(!isset($page_name))exit("Сюда нельзя!");
function set($id){$seting_ar=mysql_fetch_array(mysql_query("SELECT * FROM `shurik_setting` WHERE `id`='$id'")); echo $seting_ar['value'];}
echo'<!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><!--#0-->
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title>'.$page_name.' '; echo set(1); echo '</title>
<link rel="shortcut icon" href="images/favicon.ico" />

</head>
<body>
																												<!-- БЕСПЛАТНАЯ ВЕРСИЯ CMS BY SHuRiK v.1.0 beta -->';

if(isset($_SESSION['user_id'])) {$me=mysql_fetch_array(mysql_query("select * from `shurik_users` where id=$_SESSION[user_id]"));
$ban=mysql_fetch_array(mysql_query("select * from `shurik_ban` where `user`=$me[id]"));
if(time() < $ban['razban']){$rb=$ban['razban']-time();echo "<big>Вы заблокированы!</big><br/>Причина: $ban[ban]<br/>Окончание блокировки через: $rb сек.";exit();}
}


if(!isset($dir))echo '<link rel="stylesheet" href="style.css" />';
else echo '<link rel="stylesheet" href="'.$dir.'style.css" />';
echo "<center><div class=aaaa>";
if(!isset($dir))echo "<img src='images/logo.gif'><br/><br/>";
else echo "<img src='../images/logo.gif'><br/><br/>";


function reklama($poz, $limit){$rekl_query=mysql_query("SELECT * FROM `shurik_reklama` WHERE `poz`='$poz' ORDER BY rand() LIMIT $limit");$reklama=mysql_fetch_array($rekl_query);do {echo "<a href='$reklama[url]' style='color:$reklama[color]'>$reklama[name]</a><br/>";}while($reklama=mysql_fetch_array($rekl_query)); echo '<br/>';}

if(!isset($_SESSION['user_id']) or @$me['admin']==0)echo reklama(1, 5);

if(isset($_SESSION['user_id'])){
$date=date("ndHis");
$userid=$_SESSION['user_id']; 
mysql_query ("UPDATE `shurik_users` SET `online`='$date'  WHERE `id`='$userid' LIMIT 1");


$ls_1=mysql_query("SELECT * FROM `shurik_ls` WHERE `to`='$me[login]' AND `chit`=0");
if(mysql_num_rows($ls_1) > 0 and !isset($nolsread))echo'<small><a href="mail.php?act=to"><b>Входящее сообщение ('.mysql_num_rows($ls_1).')</b></a></small><hr>';}


function smile($text)
{$smile_1=mysql_query("select * from `shurik_smile`");
$smile_2=mysql_fetch_array($smile_1);

do{$text=str_replace("$smile_2[text]", "<img src=".@$dir."images/smile/$smile_2[url]>", $text);}
while ($smile_2=mysql_fetch_array($smile_1));
return $text;}




function code($text){ 
$text=str_replace("&#032;",' ',$text);
$text=str_replace("&",'&amp;',$text);
$text=str_replace(">",'&gt;',$text);
$text=str_replace("<",'&lt;',$text);
$text=str_replace("\"",'&quot;',$text);
$text=preg_replace("/\n\n/",'<p>',$text);
$text=preg_replace("/\n/",'<br/>',$text);
$text=preg_replace("/\\\$/",'&#036;',$text);
$text=preg_replace("/\r/",'',$text);
$text=stripslashes($text);
$text=preg_replace("/\\\/",'&#092;',$text);
$text=str_replace("\r\n","<br/> ",$text);
$text=str_replace("\n\n",'<p>',$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);


return $text;}


function error($echo,$dir)
{exit ("<b>CMS by SHuRiK <font color=red>ERROR:</font></b> ".$echo.'<br/>
<a href='.@$dir.'index.php>На главную</a><br/>
<a href="javascript:history.back()">Назад</a><br/>
'.mysql_error());
}

@mysql_query("delete from `shurik_ban` where user=$me[id]");
?>