<?php /** Security - ensure this file is being included by a parent file */ define( '_VALID_ENTER', 1 ); // register to session if(!session_id()){ @session_start(); }; $ddaccordion_js = false; $animatedCollapsible = false; $slideshow_js = false; require_once("data/sitedefinitions.php"); require_once("include/initialize.php"); require_once("cpan/include/function.php"); require_once('modules/function.php'); require_once('cpan/include/stringMainpulates.php'); $addOn_dir = 'addOn/'; $kwd = ""; if(isset($_GET["kwd"])){ $kwd = $_GET["kwd"]; } $lang = ""; if(isset($_GET["lang"])){ $lang = $_GET["lang"]; } $mod = ""; if(isset($_GET["mod"])){ $mod = $_GET["mod"]; } $str = ""; if(isset($_GET["str"])){ $str = $_GET["str"]; } $xxxxx = ""; if(isset($_GET["xxxxx"])){ $xxxxx = $_GET["xxxxx"]; } $xxxxx = ""; if(isset($_GET["xxxxx"])){ $xxxxx = $_GET["xxxxx"]; } //Current page $kwd = str_replace(",,", "/", $kwd); if ($kwd=="") { $pageurl = "site/index.html"; } else { $pageurl = "site/$kwd"; } //set the language if($lang != ''){ $baseDefaulAng = $defoult_language; $defoult_language = strtolower($lang); } if($baseDefaulAng==''){ $baseDefaulAng = $defoult_language; } //End set the language // read all the page details into array if(file_exists($pageurl)){ $Array_fromFile = unserialize(file_get_contents($pageurl)); } $METATITLEBOX = $Array_fromFile[$defoult_language]['METATITLEBOX']; $METATITLEBOX = fix_charecters($METATITLEBOX); $METADESCRIPTIONBOX = $Array_fromFile[$defoult_language]['METADESCRIPTIONBOX']; $METADESCRIPTIONBOX = fix_charecters($METADESCRIPTIONBOX); $METAKEYWORDSBOX = $Array_fromFile[$defoult_language]['METAKEYWORDSBOX']; $METAKEYWORDSBOX = fix_charecters($METAKEYWORDSBOX); $METAKEYWORDSBOX = str_replace("-", "_", $METAKEYWORDSBOX); $PAGETITLESBOX = $Array_fromFile[$defoult_language]['PAGETITLESBOX']; $PAGETITLESBOX = fix_charecters($PAGETITLESBOX); $TEMPLATESELLECT = $Array_fromFile[$defoult_language]['TEMPLATESELLECT']; $CONTENT .= $Array_fromFile[$defoult_language]['CONTENTS']; //Meta tags for addOns //======================= //catalog $catalogAddon = false; $thisImage = ''; if(stristr($CONTENT, '[smoothcatalog:')){ $catalogName = getFrom_before2after($CONTENT, "[smoothcatalog:", "]"); $catalogAddon = true; } if(stristr($CONTENT, '[catalogImages:')){ $catalogName = getFrom_before2after($CONTENT, "[catalogImages:", "]"); $catalogAddon = true; } if(stristr($CONTENT, '[catalogJS:')){ $catalogName = getFrom_before2after($CONTENT, "[catalogJS:", "]"); $catalogAddon = true; } if(stristr($CONTENT, '[catalog:')){ $catalogName = getFrom_before2after($CONTENT, "[catalog:", "]"); $catalogAddon = true; } if($_GET['param_b'] != ''){ list($catalogName, $thisImage) = explode(":::", $_GET['param_b']); $catalogAddon = true; } if($catalogAddon && $catalogName !==''){ require_once('addOn/catalogBlog/metaTags.php'); } //END Meta tags for addOns //======================= //Get the defoult template $templDir = 'templates/'; $defoultTemplate_file = 'data/defoultTemplate_file.txt'; $defoultTemplate = file_get_contents($defoultTemplate_file); //for template editor position preview if($_GET['templateName'] != ''){ $defoultTemplate = $_GET['templateName']; } //for catablog (if there is unique template //($templateSellector come from addOn/catalogBlog/metaTags.php ) if($templateSellector != ''){ $defoultTemplate = $templateSellector; } $theTemplateDirectory = $templDir.$defoultTemplate.'/'; $TemplateFile = $theTemplateDirectory.$defoultTemplate.'.html'; $cssFile = $theTemplateDirectory.$defoultTemplate.'.css'; // if there is a template sellect for this page, if($TEMPLATESELLECT != '' && $TEMPLATESELLECT != 'Default'){ $defoultTemplate = $TEMPLATESELLECT; $theTemplateDirectory = $templDir.$TEMPLATESELLECT.'/'; $TemplateFile = $theTemplateDirectory.$TEMPLATESELLECT.'.html'; $cssFile = $theTemplateDirectory.$TEMPLATESELLECT.'.css'; } // find if this is a new format template or not $positionsList_file = $theTemplateDirectory.'modulePosition.txt'; $newFormatTemplate = false; if(file_exists($positionsList_file)){ // this is a new format $newFormatTemplate = true; } // if search tag clicked, scramble the METAKEYWORDSBOX in order to generate unique content if($mod == 'search'){ $METAKEYWORDSBOX = F_scramble($METAKEYWORDSBOX); $METADESCRIPTIONBOX = F_scramble_2($METADESCRIPTIONBOX); } //Add keywords to the META TITLE and METADESCRIPTIONBOX $tempkey1 = explode(',', $METAKEYWORDSBOX); $tempkey = array_unique($tempkey1); $key_add = ""; $i = 0; foreach($tempkey as $value){ if($str != $value){ if($i < $keywords_to_title && $value != ''){ // ($keywords_num from $sitedefintions.php) if($i == 0){ $key_add .= trim($value).' '; } else { $key_add .= ', '.trim($value).' '; } } $i++; } } // if search tag clicked, put keywords befor the title else title befor keywords if($mod == 'search'){ $METATITLEBOX = $str." | ".trim($key_add).' | '.$METATITLEBOX; } else { $METATITLEBOX = $METATITLEBOX .' | '.trim($key_add); } //build the head of thepage $page = ''; //for old format template only //css to reverse the top menu preferences direction if($newFormatTemplate == false){ switch($autoDirection) { case "Auto Direction": $top_Direction = TEXT('ALIGN'); break; case "Reverse Auto Direction": $top_Direction = TEXT('ALIGN_REVERSE'); break; case "To Left": $top_Direction = "left"; break; default: $top_Direction = "right"; } $temp = ''; } $template = file_get_contents('include/templates/head.html'); $template=str_replace("%%CSS_FILE%%", $cssFile, $template); $template=str_replace("%%META_TITLE%%", $METATITLEBOX, $template); $template=str_replace("%%META_KEYWORDS%%", $METAKEYWORDSBOX, $template); $template=str_replace("%%META_DESCRIPTION%%", $METADESCRIPTIONBOX, $template); $template=str_replace("%%TOMMENU_DIRECTION_CSS%%", $temp, $template); echo $template; if(file_exists($TemplateFile)){ include($TemplateFile); } else { echo '