0){$fn="$ctgfolder/art-$n.txt";}else{$fn="art-$n.txt";} if(file_exists($fn)==true){ $file=fopen($fn,'r'); $tx=fread($file,filesize($fn)); fclose($file); } else { if(file_exists("dbinfo.php")==true){ include "dbinfo.php"; $site_encoding='cp1251'; $msconnect = mysql_connect($mshost, $msuser, $mspassword); mysql_select_db($msname, $msconnect); mysql_query("SET NAMES 'utf8'"); if($site_encoding!='utf8'){ mysql_query("SET character_set_client = $site_encoding"); mysql_query("SET character_set_connection = $site_encoding"); mysql_query("SET character_set_results = $site_encoding"); } $res=mysql_query("SELECT * FROM `` WHERE page='$fn'"); if($res){ if($row=mysql_fetch_array($res)){ $tx=$row['data']; $file=fopen($fn,'w'); fwrite($file,$tx); fclose($file); } } mysql_close($msconnect); } } $k=0; $p=strpos($tx,'{#'); while($p!==false){ $p2=strpos($tx,'#}',$p); $im=substr($tx,$p+2,$p2-($p+2)); $k++; //-------------- if (file_exists("dmcr.php")) {include "dmcr.php";}else{include "../dmcr.php";} //------------- $mcr[$k]=$im; $p=strpos($tx,'{#',$p2+2); } if (file_exists("template_page.php")) {include "template_page.php";}else{include "../template_page.php";} ?>