Версия PHP интерпретатора должна быть 4.1.0 или выше, но никак не ниже (ваша версия интерпретатора: ".phpversion().")"); function error($error,$file){exit(''.$error.'
['.htmlspecialchars($file).']
');} function CheckConf($conf) { while(list($section,$array)=each($conf)) while(list($key,$value)=each($array)) if(!strlen($value)) error("В файле параметров скрипта, а именно в секции ".$section.", пуст ключ ".$key."",$conf['dir']['path']."/".$conf['dir']['inc']."/conf.1nc.dat"); } if(isset($_GET)) while(list($key,$value)=each($_GET)) $$key=$value; $trm=null; $trm=parse_ini_file("./1nc/conf.1nc.dat",1) or error("не могу загрузить основной файл конфигурации","./1nc/conf.1nc.dat"); CheckConf($trm); if(!is_dir($trm['dir']['path']."/".$trm['dir']['inc'])) error("не найдена системная папка скрипта",$trm['dir']['path']."/".$trm['dir']['inc']); if(!is_dir($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates'])) error("не найдена папка, в которой должны храниться все шаблоны скрипта",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates']); if(!is_dir($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates']."/".$trm['template']['parse'])) error("не найдена папка, в которой должны находиться шаблонные файлы",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates']."/".$trm['template']['parse']); if(!is_readable($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates']."/".$trm['template']['parse']."/conf.1nc.dat")) error("не могу загрузить специальный файл конфигурации для шаблона",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates']."/".$trm['template']['parse']."/conf.1nc.dat"); else $trm=array_merge($trm,parse_ini_file($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates']."/".$trm['template']['parse']."/conf.1nc.dat",1)); while(list(,$file)=each($trm['templates'])) { if(file_exists($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates']."/".$trm['template']['parse']."/".$file)) { if(!is_readable($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates']."/".$trm['template']['parse']."/".$file)) error("не могу прочитать один из шаблонов /нет прав/",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates']."/".$trm['template']['parse']."/".$file); } else error("не найден один из шаблонов /файл не существует/",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['dir']['templates']."/".$trm['template']['parse']."/".$file); } if(!include($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['functions'])) error("не могу загрузить файл с функциями",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['functions']); elseif(!include($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['interpreter'])) error("не могу загрузить файл с интерпретатором",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['interpreter']); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); if(!empty($trm['closed']['closed'])) { if(!file_exists($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base'])) error("не найден файл с базой сообщений",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base']); elseif(!is_readable($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base'])) error("не могу прочитать базу с сообщениями, нет прав на чтение",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base']); else $trm['base']=array_reverse(trm_read_file($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base'])); parse_template($trm['templates']['top']); parse_template($trm['templates']['closed']); if(!empty($trm['closed']['messages'])) ShowMessages(); parse_template($trm['templates']['bottom']); exit; } if(!$_POST) { if(isset($_COOKIE['trm_board_cookie_name'])) $trm['other']['cookie_name']=trm_stripslashes($_COOKIE['trm_board_cookie_name']); else $trm['other']['cookie_name']=null; if(isset($_COOKIE['trm_board_cookie_firm'])) $trm['other']['cookie_firm']=trm_stripslashes($_COOKIE['trm_board_cookie_firm']); else $trm['other']['cookie_firm']=null; if(isset($_COOKIE['trm_board_cookie_country'])) $trm['other']['cookie_country']=trm_stripslashes($_COOKIE['trm_board_cookie_country']); else $trm['other']['cookie_country']=null; if(isset($_COOKIE['trm_board_cookie_city'])) $trm['other']['cookie_city']=trm_stripslashes($_COOKIE['trm_board_cookie_city']); else $trm['other']['cookie_city']=null; if(isset($_COOKIE['trm_board_cookie_tel'])) $trm['other']['cookie_tel']=trm_stripslashes($_COOKIE['trm_board_cookie_tel']); else $trm['other']['cookie_tel']=null; if(isset($_COOKIE['trm_board_cookie_fax'])) $trm['other']['cookie_fax']=trm_stripslashes($_COOKIE['trm_board_cookie_fax']); else $trm['other']['cookie_fax']=null; if(isset($_COOKIE['trm_board_cookie_homepage'])) $trm['other']['cookie_homepage']=$_COOKIE['trm_board_cookie_homepage']; else $trm['other']['cookie_homepage']=null; if(isset($_COOKIE['trm_board_cookie_mail'])) $trm['other']['cookie_mail']=$_COOKIE['trm_board_cookie_mail']; else $trm['other']['cookie_mail']=null; if(isset($_COOKIE['trm_board_cookie_icq'])) $trm['other']['cookie_icq']=$_COOKIE['trm_board_cookie_icq']; else $trm['other']['cookie_icq']=null; $trm['other']['cookie_message']=null; } else { $trm['other']['cookie_name']=trm_stripslashes($_POST['name']); $trm['other']['cookie_firm']=trm_stripslashes($_POST['firm']); $trm['other']['cookie_country']=trm_stripslashes($_POST['country']); $trm['other']['cookie_city']=trm_stripslashes($_POST['city']); $trm['other']['cookie_tel']=trm_stripslashes($_POST['tel']); $trm['other']['cookie_fax']=trm_stripslashes($_POST['fax']); $trm['other']['cookie_homepage']=trm_stripslashes(eregi_replace("http://",null,$_POST['homepage'])); $trm['other']['cookie_mail']=trm_stripslashes($_POST['mail']); $trm['other']['cookie_icq']=trm_stripslashes($_POST['icq']); $trm['other']['cookie_message']=trm_stripslashes($_POST['message']); if(!empty($_COOKIE['trm_board_cookie_flood'])) $_COOKIE['trm_board_cookie_flood']+=$trm['numeric']['flood']*60; else $_COOKIE['trm_board_cookie_flood']=0; if(empty($_COOKIE['trm_board_cookie_message'])) $_COOKIE['trm_board_cookie_message']=null; if($_COOKIE['trm_board_cookie_flood']>time()) $trm['other']['error']=sprintf($trm['error']['flood'],$trm['numeric']['flood']); elseif(!isset($_SERVER['REMOTE_ADDR'])) $trm['other']['error']=$trm['error']['unknown_ip']; elseif(!$trm['other']['cookie_name']) $trm['other']['error']=$trm['error']['empty_name']; elseif(strlen($trm['other']['cookie_name'])<$trm['numeric']['min_name']) $trm['other']['error']=sprintf($trm['error']['min_name'],$trm['numeric']['min_name']); elseif(strlen($trm['other']['cookie_name'])>$trm['numeric']['max_name']) $trm['other']['error']=sprintf($trm['error']['max_name'],$trm['numeric']['max_name']); elseif(!eregi("^((www)?)+(([a-z0-9_.-]+)?)[a-z0-9]+\.+[a-z]{2,4}$",$trm['other']['cookie_homepage'])&&$trm['other']['cookie_homepage']) $trm['other']['error']=$trm['error']['invalid_homepage']; elseif(!eregi("^[a-z0-9]+(([a-z0-9_.-]+)?)@[a-z0-9+](([a-z0-9_.-]+)?)+\.+[a-z]{2,4}$",$trm['other']['cookie_mail'])&&$trm['other']['cookie_mail']) $trm['other']['error']=$trm['error']['invalid_mail']; elseif(!is_numeric($trm['other']['cookie_icq'])&&$trm['other']['cookie_icq']) $trm['other']['error']=$trm['error']['invalid_icq']; elseif(!eregi("^[0-9]",$trm['other']['cookie_tel'])&&$trm['other']['cookie_tel']) $trm['other']['error']=$trm['error']['invalid_tel']; elseif(!Spam($trm['other']['cookie_name'])) $trm['other']['error']=$trm['error']['spam']; elseif(!Spam($trm['other']['cookie_firm'])) $trm['other']['error']=$trm['error']['spam']; elseif(!Spam($trm['other']['cookie_tel'])) $trm['other']['error']=$trm['error']['spam']; elseif(!Spam($trm['other']['cookie_fax'])) $trm['other']['error']=$trm['error']['spam']; elseif(!Spam($trm['other']['cookie_homepage'])) $trm['other']['error']=$trm['error']['spam']; elseif(!Spam($trm['other']['cookie_mail'])) $trm['other']['error']=$trm['error']['spam']; elseif(!Spam($trm['other']['cookie_icq'])) $trm['error']['spam']; elseif(!Spam($trm['cookie_message'])) $trm['spam']; elseif(!eregi("^[0-9]",$trm['other']['cookie_fax'])&&$trm['other']['cookie_fax']) $trm['other']['error']=$trm['error']['invalid_fax']; elseif(strlen($trm['other']['cookie_tel'])<$trm['numeric']['min_tel']&&$trm['other']['cookie_tel']) $trm['other']['error']=sprintf($trm['error']['min_tel'],$trm['numeric']['min_tel']); elseif(strlen($trm['other']['cookie_fax'])<$trm['numeric']['min_fax']&&$trm['other']['cookie_fax']) $trm['other']['error']=sprintf($trm['error']['min_fax'],$trm['numeric']['min_fax']); elseif(strlen($trm['other']['cookie_tel'])>$trm['numeric']['max_tel']&&$trm['other']['cookie_tel']) $trm['other']['error']=sprintf($trm['error']['max_tel'],$trm['numeric']['max_tel']); elseif(strlen($trm['other']['cookie_fax'])>$trm['numeric']['max_fax']&&$trm['other']['cookie_fax']) $trm['other']['error']=sprintf($trm['error']['max_fax'],$trm['numeric']['max_fax']); elseif(strlen($trm['other']['cookie_icq'])<$trm['numeric']['min_icq']&&$trm['other']['cookie_icq']) $trm['other']['error']=sprintf($trm['error']['min_icq'],$trm['numeric']['min_icq']); elseif(!$trm['other']['cookie_message']) $trm['other']['error']=$trm['error']['empty_message']; elseif(!CheckWords($trm['other']['cookie_message'])) $trm['other']['error']=sprintf($trm['error']['max_word'],$trm['numeric']['max_word']); elseif($_COOKIE['trm_board_cookie_message']==$trm['other']['cookie_message']) $trm['other']['error']=$trm['error']['try_flood']; elseif(!Spam($trm['other']['cookie_message'])) $trm['other']['error']=sprintf($trm['error']['spam'],$trm['error']['spam']); elseif(strlen($trm['other']['cookie_message'])>$trm['numeric']['max_message']) $trm['other']['error']=sprintf($trm['error']['max_message'],$trm['numeric']['max_message']); elseif(is_array($ban=Banlist($_SERVER['REMOTE_ADDR']))) $trm['other']['error']=sprintf($trm['error']['ban'],$ban[0],$ban[1]); $trm['other']['cookie_name']=htmlspecialchars($trm['other']['cookie_name']); $trm['other']['cookie_firm']=htmlspecialchars($trm['other']['cookie_firm']); $trm['other']['cookie_country']=htmlspecialchars($trm['other']['cookie_country']); $trm['other']['cookie_city']=htmlspecialchars($trm['other']['cookie_city']); $trm['other']['cookie_tel']=htmlspecialchars($trm['other']['cookie_tel']); $trm['other']['cookie_fax']=htmlspecialchars($trm['other']['cookie_fax']); $trm['other']['cookie_homepage']=htmlspecialchars($trm['other']['cookie_homepage']); $trm['other']['cookie_mail']=htmlspecialchars($trm['other']['cookie_mail']); $trm['other']['cookie_icq']=htmlspecialchars($trm['other']['cookie_icq']); $trm['other']['cookie_message']=htmlspecialchars($trm['other']['cookie_message']); if(!isset($trm['other']['error'])) { setcookie("trm_board_cookie_name", $trm['other']['cookie_name'], time()+60*60*24*365); setcookie("trm_board_cookie_firm", $trm['other']['cookie_firm'], time()+60*60*24*365); setcookie("trm_board_cookie_country", $trm['other']['cookie_country'], time()+60*60*24*365); setcookie("trm_board_cookie_city", $trm['other']['cookie_city'], time()+60*60*24*365); setcookie("trm_board_cookie_tel", $trm['other']['cookie_tel'], time()+60*60*24*365); setcookie("trm_board_cookie_fax", $trm['other']['cookie_fax'], time()+60*60*24*365); setcookie("trm_board_cookie_homepage", $trm['other']['cookie_homepage'], time()+60*60*24*365); setcookie("trm_board_cookie_mail", $trm['other']['cookie_mail'], time()+60*60*24*365); setcookie("trm_board_cookie_icq", $trm['other']['cookie_icq'], time()+60*60*24*365); setcookie("trm_board_cookie_message", $trm['other']['cookie_message'], time()+60*60*24*365); setcookie("trm_board_cookie_flood", time(), time()+60*60*24*365); $AutochangeFile=trm_read_file($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['autochange']); $array1=$array2=array(); while(list(,$string)=each($AutochangeFile)) { list($a,$b)=explode("::",$string); $array1[]=$a; $array2[]=$b; } $trm['other']['cookie_message']=preg_replace($array1,$array2,$trm['other']['cookie_message']); $open=fopen($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base'],"a"); fwrite($open,time().".".trm_char_generator("1234567890",32)."::". trm_to_normal_string($trm['other']['cookie_name'])."::". trm_to_normal_string($trm['other']['cookie_firm'])."::". trm_to_normal_string($trm['other']['cookie_country'])."::". trm_to_normal_string($trm['other']['cookie_city'])."::". $trm['other']['cookie_tel']."::". $trm['other']['cookie_fax']."::". trm_to_normal_string($trm['other']['cookie_homepage'])."::". trm_to_normal_string($trm['other']['cookie_mail'])."::". $trm['other']['cookie_icq']."::". trm_to_normal_string($trm['other']['cookie_message'])."::". $_SERVER['REMOTE_ADDR']."::::::::". chr(13).chr(10) ); fclose($open); $trm['other']['add']=1; } } if(!file_exists($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base'])) error("не найден файл с базой сообщений",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base']); elseif(!is_readable($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base'])) error("не могу прочитать базу с сообщениями, нет прав на чтение",$trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base']); else $trm['base']=array_reverse(trm_read_file($trm['dir']['path']."/".$trm['dir']['inc']."/".$trm['file']['base'])); parse_template($trm['templates']['top']); if(!isset($trm['other']['add'])) parse_template($trm['templates']['form']); else parse_template($trm['templates']['okay']); ShowMessages(); parse_template($trm['templates']['bottom']); ?>