ob_start(); include('load.php'); if($_GET['var']=='image') include("im.php"); include(__INCLUDES.'theme.class.php'); $NAVIG_CLASS=new Template('', 'navig.html'); #############################INT MAIN if(!$_GET['ct']&&$_GET['cx']) $_GET['ct']=$_GET['cx'];//relatime admin location becomes visible $prents=array(); $_CMSR= @unserialize(@file_get_contents(__BOX__.'content/'.__TREEFILE__)); if(!$_CMSR) $_CMSR=array(); foreach($_CMSR as $row){ $_CMST[$row['pr']][]=$row['id']; if($row['pg'] ) $_CMSD[$row['pr']][]=$row['id']; $_CMSP[$row['id']]=$row; } if(!$_GET['ct']){ $_GET['ct']=$_CMST[0][0]; } if(!$_CMSP[$_GET['ct']]['pg']&&$_GET['ct']){ function findex($ig){ global $_CMST,$_CMSP; reset($_CMST); if(!$_CMST[$ig]) return; foreach($_CMST[$ig] as $row){ if($_CMSP[$row]['pg']){ return $row; } if($_CMST[$row]){ return findex($row); } } } $_GET['ct']=findex($_GET['ct']); } //urhere------------------------------------ if($_CMSP[$_GET['ct']]){ $opo=array(); $prnt= $_CMSP[$_GET['ct']] ; while($prnt){ $opo[]= $prnt['ti'] ; if($prnt['pg']) $opol[]= ''.strip_tags($prnt['ti']).'' ; else $opol[]= $prnt['ti'] ; $prents[]=$prnt['id']; $prnt=$_CMSP[$prnt['pr']]; } $opo=array_slice($opo,0,-1); $opo=array_reverse($opo); $opol=array_slice($opol,0,-1); $opol=array_reverse($opol); } if ($_CMSP[$_GET['ct']]['eg']=='news' && isset($_GET['id'])){ $_TESTCMSO=@unserialize(@file_get_contents(__BOX__.'news/'.$_GET['ct'].'.cns')); $postfix = " - ".$_TESTCMSO[$_GET['id']]['ti']; } if($_CMSP[$_GET['ct']]['tii']) define ('MTITLE',$_CMSP[$_GET['ct']]['tii'].$postfix); define('_SURL',MAIN_URL.'?ct='.trim($_GET['ct'])); //---------------------------------------- ####################################### if($_GET['p']){ if(file_exists(__BLOKS__.$_GET['p'].".php")){ define('_SURL_','?p='.$_GET['p']); include(__BLOKS__.$_GET['p'].".php"); $lddone=true; } } if(!$lddone){ include(__INCLUDES."home.php"); }else{ if(file_exists(__BLOKS__.$_GET['p']."_blocks.php")){ include(__BLOKS__.$_GET['p']."_blocks.php"); } } ######################################## ######################################## ###############OUTPUT FORMATING FUNCTIONS define ('PRIMARY_LINK',$opo[0]); function _title(){ //render title if($_GET['fu']=='s'&& $_GET['srchbox']){ print _SEARCHRESULTS; }else{ global $opo; if($opo&&!defined('MTITLE')) print strip_tags(implode(' » ',$opo) ); elseif(defined('MTITLE')) print strip_tags(MTITLE); else print SITE_NAME; } } /////////////////////////////////////////////////// if(!function_exists('_menulnks')){ function _menulnks(){//render menu tree global $_CMST,$_CMSP,$prents,$_CMSD,$opo,$NAVIG_CLASS,$PARSEDLINKS; ########$$$$$$$$$$$$$$$$$$$$ print '
| '.$itm['ti'].' |
|