set_path(); //$templateObj->dwanetest("+++"); //Lets break the code down: $url_array=explode("/",$_SERVER['REQUEST_URI']); //not needed $site_id = $url_array[$arroffset + 1]; if(isset($url_array[$arroffset + 1])){ $site_module = $url_array[$arroffset + 1]; }; if(isset($url_array[$arroffset + 2])){ $module_action = $url_array[$arroffset + 2]; }; if(isset($url_array[$arroffset + 3])){ $p1 = $url_array[$arroffset + 3]; }; if(isset($url_array[$arroffset + 4])){ $p2 = $url_array[$arroffset + 4]; }; if(isset($url_array[$arroffset + 5])){ $p3 = $url_array[$arroffset + 5]; }; if(isset($url_array[$arroffset + 6])){ $p4 = $url_array[$arroffset + 6]; }; if(!isset($site_module)) { $site_module = ""; } switch($site_module) { case "": case "search": $templateObj = New XTemplate ($maintemplatedir . "/main.htm","",$maintemplatedir . "/"); $templateObj->assign("base",$base_url); //$templateObj->assign(site_id,$_SESSION['ses']['ste_id']); $templateObj->assign("mastersitename",$master_site_name); //Call function to display preview icon... if(($_SESSION['ses']['usr_rights_ids'] && ($_SESSION['ses']['usr_ste_id'] == $master_site_id)) || $_SESSION['ses']['admin'] == "yes") { show_hide_preview(); } //If the user has an a special user id in any of the news or page items for the admin site. if(is_specialuser($master_site_id,$_SESSION['ses']['usr_id']))show_hide_preview(); //Menu builder... include("includes/sites_menu_inc.php"); switch($module_action) { case"": //Generate events... $e = new events(); $templateObj->assign(latestevents,$e->allevents()); $templateObj->parse("main.latestevents"); //include news_views script;; include("includes/news_views_inc.php"); //Run show news for newsbytes... show_news("news_mainsite","news_mainsite_items","m",5,250,"_parent"); //Run show news for subsite news that has been included in the main site.... show_news("news_users","news_users_items","u","1",250,"_blank"); //Run show news for newsbytes... show_news("news_bytes","news_bytes_items","m",4,120,"_parent"); //Run show news for words and opinions... show_news("news_wando","news_wando_items","m",2,120,"_parent"); //Run show news for top10... show_news("news_top10","news_top10_items","m",6,120,"_parent"); //parse the newsbyte headings... $templateObj->parse("main.e_news_heading"); $templateObj->parse("main.newsbytes_heading"); //Run show pages for different areas.... //eg ... page_views($outer_pge_block,$pge_block,$pge_cat) //Centre footer dyanamic... page_views("mainpage_bottom","mainpage_bottom_item",3,"false","","",$master_site_id); //Center header.. page_views("mainpage_header","mainpage_header_item",2,"false","","",$master_site_id); //Right menu... page_views("mainpage_rightmenu","mainpage_rightmenu_item",4,"false","","",$master_site_id); break; case "phrase": //Include search script... include("shared/search_inc.php"); } break; //news... case "n": $templateObj = New XTemplate ($maintemplatedir . "/news_master.htm","",$maintemplatedir . "/"); $templateObj->assign(base,$base_url); $templateObj->assign(mastersitename,$master_site_name); $masterlink = $base_url . "/index"; $templateObj->assign(masterlink,$masterlink); $archivelink = "$base_url/index/n/a/"; $templateObj->assign(archivelink,$archivelink); //Call function to display preview icon... if(($_SESSION['ses']['usr_rights_ids'] && ($_SESSION['ses']['usr_ste_id'] == $master_site_id)) || $_SESSION['ses']['admin'] == "yes") { show_hide_preview(); } switch($module_action) { //Latest news.. case "v": $templateObj->assign(newsid,$p1); include("includes/news_display_inc.php"); include("includes/news_menulatest_inc.php"); break; //archive items.. case "a": include("includes/news_menulatest_inc.php"); include("includes/news_archive_inc.php"); } break; case "yp": include("classes/yearcalendar_class.php"); $templateObj = New XTemplate ($maintemplatedir . "/yearplannermaster.htm","",$maintemplatedir . "/"); $templateObj->assign(base,$base_url); $templateObj->assign(mastersitename,$master_site_name); $masterlink = $base_url . "/index"; $templateObj->assign(masterlink,$masterlink); $yp = new yearplanner(); $showyear = $yp->styles() . $yp->headermenu() . $yp->showyear(2); $templateObj->assign(ypshowyear,$showyear); $templateObj->parse("main.showyear"); }// end switch site_module; //Find out how many times a specific page has been viewed... include("shared/page_hitshow_inc.php"); $templateObj->parse("main"); $templateObj->out("main"); ?>