"; $back="
��������� �����"; // ������� ������ // ���������� 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

������� $date �������� ������������������� �� �������

$maintext

"; // ���� ���������� ����� ����� ������ ���������� 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[2]

$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 �� ����� ������� ������� URL. �� ��������� 50 ��������!"); $zag=$_POST['zag']; if ($zag == "" || strlen($zag) > $maxzag) exit("$shapka $back �� �� ����� ��������� ����������, ��� �� ��������� $maxzag ��������!"); $days=$_POST['days']; if ($days>"90") $days="90"; $deldt=time()+$days*86400-86400; // ��������� ���� �������� ���������� $name=str_replace("|","I",$name); $zag=str_replace("|","I",$zag); $url=str_replace("|","I",$url); $msg=str_replace("|","I",$msg); if (preg_match ("/(href)/", $msg)) exit("$shapka $back. �������! ��-�� ������� ����� ���������� ������ � ����������� ���������!"); $name=wordwrap($name,24,' ',1); // ��������� ������� ������� ������ $msg=wordwrap($msg,75,' ',1); $text="$name|$email|$zag|$url|$msg|$date|$time|$deldt|||"; $text=replacer($text); $fp=fopen("data/simpleboard.dat","a+"); flock ($fp,LOCK_EX); fputs($fp,"$text\r\n"); fflush ($fp); flock ($fp,LOCK_UN); fclose($fp); @chmod("$fp",0644); if ($sendmail==TRUE) { // �������� ��������� ������ �� ���� $headers=""; // ��������� ��� �������� ����� $headers.="Content-Type: text/html; charset=windows-1251\r\n"; $headers.="From: ".$name." <".$email.">\r\n"; $headers.="X-Mailer: WR-Sendmail PHP/".phpversion(); // �������� ��� ���������� � ���� ������ $allmsg = $sbrdname.chr(13).chr(10).'����� ���������� : '.$surl.chr(13).chr(10).'���: '.$name.chr(13).chr(10).'E-mail: '.$email.chr(13).chr(10).'���������: '.$msg.chr(13).chr(10); mail("$adminemail", "$sbrdname (����������)", $allmsg, $headers); // ���������� ������ ������� �� �������� ;-) } print "$shapka
�������, $name, ���� ��������� ������� ���������.

����� ��������� ������ �� ������ ������������� ���������� �� ������� �������� ����� ����������.

������� �����, ���� �� ������ ������ �����
"; exit; } // ������� �������� ����� print "$fullshapka"; if (isset($_GET['add'])) { // ���� ������ ������ �������� ��������� - �� ������� ����� print "

���������� ����������

"; if ($antispam==TRUE) nospam(); // �������� print"
��������, ��� � E-mail 
��������� (�� ����� 50 ��������)
URL (�� ��������� http://)
�������������
(����������� ������� ����������)
     
����������
(������� 100 �
�������� $maxmsg ��������)
���� �������� ����������:
(7-90 ����)


"; } // ������� 1-�� �������� � ������������ if (is_file("data/simpleboard.dat")) { // ��������� ���� ������ � ����� $lines=file("data/simpleboard.dat"); $itogo=count($lines); $maxi=$itogo-1; // ������� ������������ �����! if ($itogo>0) { $tekdate=time(); $i="0"; $newi="-1"; $todelete="0"; do {$dt=explode("|",$lines[$i]); if ($dt[7]<$tekdate) {$todelete++;} else {$newi++; $newlines[$newi]=$lines[$i];} $i++; } while($i<$itogo); if (isset($newlines)) {$newitogo=count($newlines)-1;} else {$newitogo="0"; $newlines[0]="";} if ($todelete>"0") { $fp=fopen("data/simpleboard.dat","a+"); flock ($fp,LOCK_EX); ftruncate ($fp,0);//������� ���������� ����� for ($i=0; $i <= $newitogo; $i++) {fputs($fp,$newlines[$i]);} flock ($fp,LOCK_UN); fclose($fp); // ��������� ������ ������� � ������ ����� - ��� ��� �� ������� ������������ $lines = file("data/simpleboard.dat"); $itogo=count($lines); $maxi=$itogo-1; } // ������� ������������ ����! } // if ($itogo>0) $itogo=count($lines); $maxi=$itogo-1; if ($itogo>0) { $maxpage=ceil(($maxi+1)/$qq); if ($page>$maxpage) {$page=$maxpage;} $fm=$maxi-$qq*($page-1); if ($fm<"0") {$fm=$qq;} $lm=$fm-$qq; if ($lm<"0") {$lm="-1";} print "
 �����:   
"; if (is_file("data/reklama.html")) include"data/reklama.html"; print""; $cm=1; do { $dt=explode("|", $lines[$fm]); $num=1+$maxi-$fm; $fm--; if (strlen($dt[4])>400) {$dt[4]=substr($dt[4],0,380); $dt[4]=preg_replace("#([^\[img\]])(http|https|ftp|goper):\/\/([a-zA-Z0-9\.\?&=\;\-\/_]+)([\W\s<\[]+)#i", "\\1������\\4", $dt[4]); $dt[4].="... ���������...";} else $dt[4]=preg_replace("#([^\[img\]])(http|https|ftp|goper):\/\/([a-zA-Z0-9\.\?&=\;\-\/_]+)([\W\s<\[]+)#i", "\\1������\\4", $dt[4]); $dt[4]=preg_replace('#\[img\](.+?)\[/img\]#','�������', $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]=str_replace("
"," ",$dt[4]); $dt[4]=wordwrap($dt[4],50,' ',1); $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); // ��������� ���-�� ���� ��������� �� ��� ������ ���������� $tday=($dt[7]-$then)/86400; if (strlen($dt[0])>12) {$dt[0]=substr($dt[0],0,9); $dt[0].="...";} $dtitle=$dt[2]; if (strlen($dt[2])>22) {$dt[2]=substr($dt[2],0,19); $dt[2].="...";} // ����� ��� ������� �� ������� if ((round(($num-1)/$colrub)*$cm)==(($num-1)/$colrub)*$cm) {$cm++; print "";} print" "; } while($lm < $fm); } // if ($itogo > 0) } // if is_file("data/simpleboard.dat") // ��������� ���������� $pageinfo - �� ������� ������� $pageinfo=""; $addpage=""; $maxpage=ceil(($maxi+1)/$qq); if ($page>$maxpage) $page=$maxpage; $pageinfo.="
��������:  "; 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"

$dt[2]

$dt[4]
���������� � $num ���������: $dt[0]
���������: $tektday/$firstday ��.

$pageinfo ����� ����������: $itogo
"; if (is_file("data/bottom.html")) include "data/bottom.html"; ?>
Powered by WR-Simpleboard © 1.4.1