'20'){die('invalid sect name');}
if(strlen($_GET['cat']) >'20'){die('invalid cat name');}
if(strlen($_GET['page']) >'40'){die('invalid page name');}
if(strlen($_GET['popup']) >'5'){die('invalid pop');}
if(strlen($_GET['name']) >'40'){die('invalid name');}
if(strlen($_GET['action']) >'40'){die('invalid action');}
if(empty($_GET['section'])) {// section eg harps main lessons etc
//$section = "main";
}else{
$section = $_GET["section"] ;//section name eg harps lessons
$section = str_replace($badn,$goodn,$section);
}
if(empty($_GET['cat'])){//category eg harp_lessons/finale/page
$cat = '' ;
}else{
$cat = $_GET["cat"] ;//get the page
$cat = str_replace($badn,$goodn,$cat);
$cat = str_replace('_','/',$cat);
}
if(empty($_GET['page'])) {
$page = "home";
$popup = 'yes';
}else{
$page = $_GET["page"] ;//get the dir
$page = str_replace($badn,$goodn,$page);
}
/// if someone calls for index.php?page=index we must redirect to page=home
//or they will be caught in an infinite loop
if( empty($_GET['section']) AND empty($_GET['cat']) AND $_GET['page']=='index') {
$page = "home";
$popup = 'yes';
}
if(empty($_GET['temp'])) {//template default is 3 col template
$temp = "3";
}elseif($_GET['temp']){//2 col template
$temp = '2';//get the dir
//$temp = str_replace($badn,$goodn,$temp);
}
if(empty($_GET['popup'])){
$popup = '' ;
}else{
$popup = $_GET["popup"] ;//get the page
$popup = str_replace($badn,$goodn,$popup);
$popup = str_replace('_','/',$popup);
}
if(empty($_GET['name'])){
$name = '';
}else{
$name = $_GET['name'];
$name = str_replace($badn,$goodn,$name);
}
if(empty($_GET['action'])){
$action = 'home';
}else{
$action = $_GET['action'];
}
$page_login = "$page";
//$main = "$page";
if("$section" == 'logs' ){
$main = ("logs".'/'."$page".'.'.'html');
}elseif($section AND !$cat ){
$main = ("$section"."/"."$page" . "." .'php');
}elseif($cat AND $section ){
$main = ("$section".'/'."$cat"."/"."$page" . "." .'php');
}else{
$main = ("$page" . "." .'php'); //name of included main file
}
echo $main;
/// get main functions file
//require_once ('phpstuff/functions.php');
//open navbar db to read template news links etc etc etc
//use correct navbar for section if a navbar for the section doesnt exist use main navbar
# echo "$servroot/includes/zzz_z"."$section".".csv
";
if(file_exists("$servroot/includes/zzz_z"."$section".".csv")){
$nav = file("$servroot/includes/zzz_z"."$section".".csv");
# echo "$servroot/includes/zzz_z"."$section".".csv
";
}else{
$nav = file("$servroot/includes/zzz_znavmain.csv");
}
# $nav = file("$servroot/includes/zzz_znavmain.csv");
foreach($nav as $key => $rest){
list( $id,$type,$pp,$sectn,$catt,$pge,$lk_nme,$pp_text,$cption,$stcky,$shw,$footr,$newsflash,$tempn)= explode(',',$rest);
# echo"$section=$sectn|$cat=$catt|$page=$pge
";
if($id!='#' AND $section =="$sectn" AND $cat == "$catt" AND $page == strtok($pge,'.')){
# echo " $type-$pp-$newsflash-$temp-$section/$catt/$pge
";
$templ = trim($tempn);//template type
$tipe = trim($type);//url type we are looking for web_link eg to other folders on site bulletin board shop etc.
$newsfl = trim($newsflash);//newsflash banner
}
//break;
# echo "$tipe-$newsfl-$templ-|$sectn|$catt|$pge-$page
";
}
if($tipe =='web_link'){
# header("Location: $server/$section/$page"); /* Redirect browser */
}
//echo "
$tipe--$newsfl--$templ-
";
if($action == 'print'){
require ('a_template_print.php'); // template for printing
}elseif("$templ"=='3' OR page_template()=='3'){
require ('includes/b_template_3col.php'); //require main template 3 col
}elseif("$templ"=='2' OR page_template()=='2'){
require ('includes/b_template_2col.php'); //require main template 2 col
}elseif("$templ"==''){
require ('includes/b_template_2col.php'); //require main template 3 col default
}
//-----------------//////////////////////////////////------------------------------------
//}
ob_end_flush();
?>