��������� ����� "; // ������� ������
// ���������� URL �������
$host=$_SERVER["HTTP_HOST"]; $self=$_SERVER["PHP_SELF"]; $surl=str_replace('index.php','',"http://$host$self");
function replacer ($text) { // ������� ������� ����
$text=str_replace(" ",' ',$text);
$text=str_replace(">",'>',$text);
$text=str_replace("<",'<',$text);
$text=str_replace("\"",'"',$text);
$text=preg_replace("/\n\n/",'',$text);
$text=preg_replace("/\n/",' ',$text);
$text=preg_replace("/\\\$/",'$',$text);
$text=preg_replace("/\r/",'',$text);
$text=preg_replace("/\\\/",'\',$text);
// ���� magic_quotes �������� - ������ ����� ����� � ���� �������: ��������� (') � ������� ������� ("), �������� ���� (\)
if (get_magic_quotes_gpc()) { $text=str_replace("\"",'"',$text); $text=str_replace("\'",'\'',$text); $text=str_replace("\\",'\',$text); }
$text=str_replace("\r\n"," ",$text);
$text=str_replace("\n\n",'
',$text);
$text=str_replace("\n",' ',$text);
$text=str_replace("\t",'',$text);
$text=str_replace("\r",'',$text);
$text=str_replace(' ',' ',$text);
return $text; }
function nospam() { global $max_key,$rand_key; // ������� �������� 2011 !
if (array_key_exists("image", $_REQUEST)) { $num=replacer($_REQUEST["image"]);
for ($i=0; $i<10; $i++) {if (md5("$i+$rand_key")==$num) {imgwr($st,$i); die();}} }
$xkey=""; mt_srand(time()+(double)microtime()*1000000);
$dopkod=mktime(0,0,0,date("m"),date("d"),date("Y")); // ���.���: �������� ������ 24 ����
$stime=md5("$dopkod+$rand_key");// ���.���
echo'';
$nummax=0; for ($i=0; $i<=$max_key; $i++) {
$snum[$i]=mt_rand(0,9); $psnum=md5($snum[$i]+$rand_key+$dopkod);
$secret=mt_rand(0,1); $styles='';
if ($nummax<3) { if ($secret==1 or $i==0) {$styles='bgcolor=#FFFF00'; $xkey=$xkey.$snum[$i]; $nummax++;}}
echo "\r\n";}
$xkey=md5("$xkey+$rand_key+$dopkod"); //����� + ���� �� config.php + ��� ���������� ����� 24 ����
print"
�������� ���:
(������� �����, ������� �� ����� ���� )
";
return; }
function replace_links($string=null) {
$string=preg_replace ("#([^\[img\]])(http|https|ftp|goper):\/\/([a-zA-Z0-9\.\?&=\;\-\/_]+)([\W\s<\[]+)#i", "\\1\\2://\\3 \\4", $string);
$string=preg_replace('#\[img\](.+?)\[/img\]#',' ',$string); // ��������� ������ ����� ������ ������ URL!!!
return $string; }
if (isset($_GET['page'])) $page=$_GET['page']; else $page="1";
if ($page==0) $page="1"; else $page=abs($page);
$fullshapka="$sbrdname
$sbrdname
";
// ���� ���������� ����� ����� ������ ����������
if (isset($_GET['id'])) { if ($_GET['id']!="") {
// ��������� ���������� �������, � ������������ ������ ����������
$fullshapka=str_replace("",' ',$fullshapka);
print"$fullshapka";
$lines=file("data/simpleboard.dat"); $itogo=count($lines);
$viewmsg=$_GET['id']+1; $last=$itogo-2;
if ($viewmsg>$itogo or $viewmsg<-1) exit("���� ���������� ������� ���������� �������. �� ������ ������� �� ������� �������� ����� ��� �� ��������� ����������� ���������� .");
$dt=explode("|",$lines[$viewmsg]);
$dt[4]=replacer($dt[4]);
$dt[4]=str_replace("[b]","", $dt[4]); $dt[4]=str_replace("[/b]"," ", $dt[4]);
$dt[4]=str_replace("[RB]","", $dt[4]); $dt[4]=str_replace("[/RB]"," ", $dt[4]);
$dt[4]=replace_links($dt[4]);
$deldate=date("d.m.Y",$dt[7]); // ������������ ���� �������� � ������������ ������
$fd=explode(".",$dt[5]);
$then=mktime(0,0,0,$fd[1],$fd[0],$fd[2]);
$firstday=round(($dt[7]-$then)/86400); // ��������� ���-�� ���� ����������� ����������
$today=time();
$tektday=round(($today-$then)/86400); // ��������� ���-�� ���� ��������� �� ��� ������ ����������
print"
$dt[4]
���� ������: $dt[5] ���������: $dt[0] ���� ��������: $deldate
���������: $tektday/$firstday ��.
";
exit; } }
// ���� ���������� ����������
if (isset($_GET['save'])) {
// ���������� �������� ������ �� ����� � ����������� �� ����������
if (isset ($_POST['name']) & isset ($_POST['msg']) & isset ($_POST['email'])) {$name=$_POST['name']; $msg=$_POST['msg']; $email=$_POST['email'];} else exit;
if (isset($_GET['page'])) $page=$_GET['page']; else $page=1;
sleep(1); // ������ ������ �� �����. �������� ������� �� ����� - � ����� �� ������� ����� - ����� �������� ����� � �� ��������� ������
//--�-�-�-�-�-�-�-�--�������� ����--
if ($antispam==TRUE and !isset($_COOKIE['wrfcookies'])) {
if (!isset($_POST['usernum']) or !isset($_POST['xkey']) or !isset($_POST['stime']) ) exit("������ �� ����� �� ���������!");
$usernum=replacer($_POST['usernum']); $xkey=replacer($_POST['xkey']); $stime=replacer($_POST['stime']);
$dopkod=mktime(0,0,0,date("m"),date("d"),date("Y")); // ���.���. �������� ������ 24 ����
$usertime=md5("$dopkod+$rand_key");// ���.���
$userkey=md5("$usernum+$rand_key+$dopkod");
if (($usertime!=$stime) or ($userkey!=$xkey)) exit("����� ��������� ���!");}
if ($name=="" || strlen($name) > $maxname) exit("$shapka $back ���� ��� ��� ������, ��� ��������� $maxname ��������! ");
if (strlen($msg)<50 || strlen($msg)>$maxmsg) exit("$shapka $back ���� ��������� �������� ��� ����� 50 �������� ��� ��������� $maxmsg ��������. ");
if (!preg_match('/^([0-9a-zA-Z]([-.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+[a-zA-Z]{2,9})$/si',$email) and strlen($email)>30 and $email!="") exit("$shapka $back � ������� ���������� E-mail �����! ");
$url=$_POST['url']; if (strlen($url) > 50) exit("$shapka $back �� ��������: ";
if ($page>3 and $maxpage>5) $pageinfo.="
1 ... ";
$f1=$page+2; $f2=abs($page-2); if ($f2=="0") $f2=1; if ($page>=$maxpage-1) $f1=$maxpage;
if ($maxpage<=5) {$f1=$maxpage; $f2=1;}
for($i=$f2; $i<=$f1; $i++) { if ($page==$i) $pageinfo.="
$i ";
else {if ($i!=1) $addpage="index.php?page=$i"; $pageinfo.="
$i ";} }
if ($page<=$maxpage-3 and $maxpage>5) $pageinfo.="...
$maxpage ";
$pageinfo.='
';
print"