lang="ru"; ParseURL(); if (is_array($CONFIG->site_name)){ $site_name=$CONFIG->site_name[$DOCUMENT->lang]; unset($CONFIG->site_name); $CONFIG->site_name=$site_name; } if ($MENU_DATA[$DOCUMENT->menu_id]->theme_id>0){ $q="SELECT alias FROM engine_theme WHERE id={$MENU_DATA[$DOCUMENT->menu_id]->theme_id}"; $DOCUMENT->theme_name=mysql_result(mysql_query($q),0); echo mysql_error(); }else{ $th_lev_id=$DOCUMENT->menu_id; while ($th_lev_id>0){ if ($MENU_DATA[$th_lev_id]->theme_id>0){ $q="SELECT alias FROM engine_theme WHERE id={$MENU_DATA[$th_lev_id]->theme_id}"; $DOCUMENT->theme_name=mysql_result(mysql_query($q),0); break; }else{ $th_lev_id=$MENU_DATA[$th_lev_id]->parent_id; } } } // if ($_SERVER["REDIRECT_STATUS"]=="403"){ // header("Status: 403"); // } if (($DOCUMENT->menu_id==0)){ header("Status: 404"); print "Страница не найдена"; exit(); } if (isset($CONFIG->REDIRECT["/$DOCUMENT->this_uri"])){ header("Location: ".$CONFIG->REDIRECT["/$DOCUMENT->this_uri"]."\n\n"); } $DOCUMENT->this_url=$CONFIG->base_href.$DOCUMENT->this_uri.".html"; $DOCUMENT->base_href=design("Main","base_href"); $DOCUMENT->content=BuildContent($DOCUMENT->menu_id); // LinkFinal(); // Для баланс-сервиса делали, строит список перекрестных ссылок $blocks_list=mysql_query("SELECT * FROM engine_block"); echo mysql_error(); // if ($DOCUMENT->titles[0]=="English") array_shift($DOCUMENT->titles); while ($bl=mysql_fetch_object($blocks_list)){ MenuBuildLinks($bl->menu_id); if ((!isset($DOCUMENT->blocks[$bl->id]))&&($bl->active>0)){ $bl->content=BlockExec($bl->name,$MENU_DATA[$bl->menu_id]->link,$DOCUMENT->menu_id,$bl->value); $DOCUMENT->blocks[$bl->id]=$bl; $DOCUMENT->blocks[$bl->name]=$bl; } } $way_urls=explode("/",$DOCUMENT->this_uri); $p_way="."; $way_n=0; for ($n=0;$ntitles);$n++){ if (($DOCUMENT->titles[$n]==$DOCUMENT->titles[$n+1])){ for ($m=$n;$mtitles);$m++){ $DOCUMENT->titles[$m]=$DOCUMENT->titles[$m+1]; } unset($DOCUMENT->titles[sizeof($DOCUMENT->titles)-1]); } } $max_way_n=sizeof($DOCUMENT->titles); // print_r($DOCUMENT); if ($DOCUMENT->this_uri!=""){ $DOCUMENT->ways[]="Главная"; }else{ $DOCUMENT->ways[]="Главная"; } foreach ($way_urls as $w_url){ if ($way_n+1==$max_way_n) {break;} $p_way.="/$w_url"; $DOCUMENT->ways[]="".$DOCUMENT->titles[$way_n].""; $way_n++; } $DOCUMENT->title=@join(" — ",$DOCUMENT->titles); $DOCUMENT->rtitle=@join(" — ",array_reverse($DOCUMENT->titles)); if ($DOCUMENT->page_title==""){ $DOCUMENT->page_title=$DOCUMENT->titles[sizeof($DOCUMENT->titles)-1]; } $DOCUMENT->menu=Menu($DOCUMENT->menu_id); $DOCUMENT->opentime=OpenTime(); $DOCUMENT->header=@join("\n",$DOCUMENT->headers); // print_r($DOCUMENT); Counter($DOCUMENT->title,"/".$DOCUMENT->this_uri); print design("Main","Main",$DOCUMENT); ?>