db_connect_id) die($lang['Wrong_Db']); // Define global constants from database // $res = $db->sql_query("select name, value from hostrev_globals"); while( $row = $db->sql_fetchrow( $res ) ){ $_constants_code .= "define($row[name],\"$row[value]\");\n"; } eval( $_constants_code ); eval( GET_GLOBALS_CODE ); // Begin Extracting Navigations // // Initializations $page_id = $page_id ? $page_id : 1; $cat_id = $cat_id ? $cat_id : 1; $id = $id ? $id : 1; $meta_id = 1; $printbuf = array(); if( $table and $filename ){ eval("\$table_name = $table;"); $result = $db->sql_query("select id, meta_id from $table_name where filename = '$filename'"); $row = $db->sql_fetchrow( $result ); if( !$row[id] ) { $page_id = 1; $cat_id = 1; $id = 1; $meta_id = 1; include "includes/link_errors.inc.php"; } else { $id = $row[id]; $meta_id = $row[meta_id] ? $row[meta_id] : 1; } } switch( $page_id ) { case 3: $id = 0; case 2: $art = new article(); $art->init(ARTICLES_TABLE, $id); break; case 5: $id = 0; case 4: if( $action == "single_press"){ $press = new press(); $press->init(PRESS_TABLE, $id); } else { $news = new news(); $news->init(NEWS_TABLE, $id); } break; case 7: $id = 0; case 6: $interviews = new interviews(); $interviews->init(INTERVIEWS_TABLE, $id); break; case 22: $editors_desk = new editors_desk(); $editors_desk->init(EDITORS_DESK_TABLE, $id); break; } $result = $db->sql_query("SELECT n.id, n.name, n.table_name, n.left_id, n.right_id, n.head_id, c.filename as contents, c.head_contents, m.id as meta_id, m.title, m.description, m.keywords FROM ".NAVIGATION_TABLE." n INNER JOIN ".CONTENTS_TABLE." c on n.contents_id = c.id INNER JOIN ".METAPAGES_TABLE." m on n.meta_id = m.id WHERE n.id = '$page_id' AND n.category = '$cat_id'") or die( mysql_error() ); $rows = $db->sql_numrows($result); if( !$rows ){ $navig = array("left_id" => 1, "right_id" => 1, "contents" => "main_contents.php" ); } else { $navig = $db->sql_fetchassoc($result); if( $navig[meta_id] and $meta_id == 1 ){ $meta_id = $navig[meta_id]; } } $row = $db->sql_single_row("select filename from ".T_FRAMES_TABLE. " where id = '$navig[head_id]'"); $head_inner = $row[filename] ? $row[filename] : SSI_TOP; if($navig[left_id]==='0'){ $left_inner = FALSE; }else{ $row = $db->sql_single_row("select filename from ".L_FRAMES_TABLE. " where id = '$navig[left_id]'"); $left_inner = $row[filename] ? $row[filename] : SSI_LEFT; } if($navig[right_id]==='0'){ $right_inner = FALSE; }else{ $row = $db->sql_single_row("select filename from ".R_FRAMES_TABLE. " where id = '$navig[right_id]'"); $right_inner = $row[filename] ? $row[filename] : SSI_RIGHT; } $banner_change_res = $db->sql_query("select * from ".BANNER_CHANGE_TABLE." where nav_id='$page_id' and ('$filename' like filename or filename='all') and enabled='y' limit 1"); $banner_change_row=$db->sql_fetchrow($banner_change_res); $result = $db->sql_query("select m.title, m.description, m.keywords from ".METATAGS_TABLE." m where m.id = $meta_id") or die( mysql_error() ); $meta_tags = $db->sql_fetchrow( $result ); if(stripos($meta_tags[title],$defmeta['site'])===false){ $meta_tags[title].=$defmeta['prefix'].$defmeta['site']; } // Check for Prestitial (commersial) // $c_prestitial=$_COOKIE[prestitial]; if( preg_match( "/Mozilla/", $_SERVER[HTTP_USER_AGENT] )&&!preg_match( "/google/i", $_SERVER[HTTP_USER_AGENT] ) ){ // Show prestitial advert only if browser detected and not google - Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) 66.249.65.19 if(preg_match("/$_SERVER[SERVER_NAME]/",$_SERVER['HTTP_REFERER'])){ $c_prestitial=1; }elseif(!$c_prestitial&&$banner_prestitial=get_phpAdsNew_banners(110,1)){ $_prestitial[display_period]=24; $_prestitial[refresh_interval]=10; } } if( !$_COOKIE[order_by] ) $_COOKIE[order_by]='date'; if( !$_COOKIE[order_direction] ) $_COOKIE[order_direction]='desc'; $_COOKIE[prestitial]=(($_COOKIE[prestitial]||$banner_prestitial)?1:0); setcookie("order_by", $_COOKIE[order_by], time()+ 24*60*60,"/" ); setcookie("order_direction", $_COOKIE[order_direction], time()+ 24*60*60,"/" ); setcookie("prestitial", (($_COOKIE[prestitial]||$banner_prestitial)?1:0), time()+ 24*60*60,"/" ); ?>
$meta_tags[title] \n"; if( $_prestitial and !$c_prestitial ){ echo "\n"; } require("contents/count.php"); ?>