PageID)) include("second.html"); else include("first.html"); include("footer.html");*/ /*include("../data/config/const.inc"); $m1 = mysql_connect(dbhost, dbuser, dbpassword); mysql_select_db(dbname); mysql_query("SET NAMES cp1251"); function regexpEscape($str) { return preg_quote($str, '/'); } $mRequestUri = $_SERVER["REQUEST_URI"]; //получаем REQUEST_URI if ( $mRequestUri == '/' ) //если пользователь обратился к главной странице { $mPageUrl = $mRequestUri; } else { if ( $_SERVER['QUERY_STRING'] ) { $mPageUrl = preg_replace (array('/^\//', '/\/?\?'.RegexpEscape($_SERVER['QUERY_STRING']).'$/'), array('',''), $mRequestUri ); } else { $mPageUrl = preg_replace (array('/^\//', '/\/?\??$/'), array('',''), $mRequestUri ); } $arQ = explode("/", $mPageUrl); $iCarQ = count($arQ); if (isset($arQ[$iCarQ-3]) && $arQ[$iCarQ-3]=="news") { $_GET['pg10']=intval($arQ[$iCarQ-2]); $_GET['nid']=intval($arQ[$iCarQ-1]); $HTTP_GET_VARS['pg10']=intval($arQ[$iCarQ-2]); $HTTP_GET_VARS['nid']=intval($arQ[$iCarQ-1]); unset($arQ[$iCarQ-2]); unset($arQ[$iCarQ-1]);} else if (isset($arQ[$iCarQ-2]) && $arQ[$iCarQ-2]=="news") { $_GET['pg10']=intval($arQ[$iCarQ-1]); $HTTP_GET_VARS['pg10']=intval($arQ[$iCarQ-1]); unset($arQ[$iCarQ-1]);} $sAlias = $arQ[count($arQ)-1]; $sPath=""; for ($i=0; $iParents)>0) $p_id=$Interface->Parents[0]['sitesection_id']; else {if (isset($id)) $p_id = $id; else $p_id=0;} if($p_id!=0 && $p_id!=WORKS_PAGE && $p_id!=NAPR_PAGE) { $sImg="/files/sitesection/picture_1.jpg"; $qimg = new TMySQLQuery("select picture from sys_sitemap where sitesection_id=$id and picture!=''"); if (!$qimg->eof && is_file($DOCUMENT_ROOT."/files/sitesection/".$qimg->row['picture'])) $sImg ="/files/sitesection/{$qimg->row['picture']}"; if ($p_id==NEWS_PAGE) { if (isset($nid)) { $qnewsimg = new TMySQLQuery("select picture from news where news_id=$nid and picture!=''"); if (!$qnewsimg->eof && is_file($DOCUMENT_ROOT."/files/news/".$qnewsimg->row['picture'])) $sImg ="/files/news/{$qnewsimg->row['picture']}"; } else { if (isset($pg10)) $l = 5*(intval($pg10)-1); else $l=0; $qnewsimg = new TMySQLQuery("select picture from news where picture!='' order by date desc limit $l, 1"); if (!$qnewsimg->eof && is_file($DOCUMENT_ROOT."/files/news/".$qnewsimg->row['picture'])) $sImg ="/files/news/{$qnewsimg->row['picture']}"; } } if ($sImg=="/img/temp_about.jpg") { $arimg = SQLToSimpleArray("select picture from sys_sitemap where picture!=''", 'picture'); $countimg = count($arimg); if ($countimg>0) { $r = mt_rand(0, $countimg-1); while (!is_file($DOCUMENT_ROOT."/files/sitesection/".$arimg[$r])) { $r = mt_rand(0, $countimg-1); $sImg ="/files/sitesection/{$arimg[$r]}"; } } } } include("header.php"); if (isset($Interface->PageID)) include("second.php"); else include("first.php"); include("footer.php");*/ ?>