0)$object.="/"; $object.=$tmp[$counter]; $counter++; } $queryStr = $tmp[count($tmp)-1]; if (strlen($tmp[count($tmp)-1])>0) { $lastArg=array(); $lastArg=explode("___",$tmp[count($tmp)-1]); array_push($argvArticles,""); $counter=0; foreach($lastArg as $val) { $tmp=explode("=",$val); if($tmp[0]=='A') { $tmp[1] += 0; array_push($argvArticles,$tmp[1]); } $argv[$tmp[0]]=$tmp[1]; $_REQUEST[$tmp[0]]=$tmp[1]; // nao funciona p vários artigos $counter++; } //$_REQUEST['A']=implode(',',$argvArticles); $_REQUEST['A']=$argvArticles[0]; $_REQUEST['A']=ereg_replace("^\,","",$_REQUEST['A']); } } // Check User-Agent $redirected=0; $rewriteLinks=""; if(!IS_BO && 0) { if($mobile=isMobileVersion($object)) { if(!file_exists(MAIN_DIR."/objects/".$object)) { $object=ereg_replace($mobile."_","",$object); $redirected=1; } else { $rewriteLinks="rewriteLinks('$mobile');"; } } } $header=""; if(!IS_BO && $object=="pages/homepage.php" && !$redirected && $_SERVER['HTTP_HOST'] == "www.lusosem.pt" && 0) { $header.=""; } $header.=" "; if(!IS_BO && strlen($rewriteLinks)>0) { $header.=""; } if(IS_BO) { $header.=" "; } // Check if static cache exists and is valid ... if(!IS_BO && !isset($_REQUEST['nocache']) && $_SERVER["REQUEST_METHOD"]!="POST") { $fName=getCacheObjectName($object,$queryStr); //print ""; if(file_exists(CACHE_DIR."/static/".$fName)) { if(!siteHasChanged(filemtime(CACHE_DIR."/static/".$fName)) && isUpdated()) { $pageContent=file_get_contents(CACHE_DIR."/static/".$fName); if (is_benchmark()) { $bench = new SS3_Benchmark($object, htmlentities($_COOKIE[BENCHMARK_COOKIE]), 'static'); $bench->start_clock(); } // Avoid Recursion in mobile version if($redirected) { $pageContent=ereg_replace("","",$pageContent); } print evalPHP($pageContent); if (is_benchmark()) { $bench->stop_clock(); $benchmark_objects[] = $bench; foreach ($benchmark_objects as $bm_obj) { if ($bm_obj->is_visible() === false) print "\n\n"; else print "\n"; } } exit; } } } // No static cache, so call renderer ... //var_dump($object); if(strlen($object)>0 && ( file_exists(TEMPLATES_DIR."/".$object) || IS_BO )) { $pageContent=mainRenderer($object,$queryStr); if(IS_BO) { $statusBar=file_get_contents(MAIN_DIR."/headerFooter/statusbar.php"); $statusBar=evalPHP($statusBar); foreach($articlesToBeApprovedQueu as $val) { $howmanyToApprove+=count($val); } $howmanyToApprove+=0; $statusBar=ereg_replace("___articlesToApprove___","$howmanyToApprove",$statusBar); if($howmanyToApprove>0)$atpIcon="iconaccept_loop.gif"; else $atpIcon="iconaccept_stop.gif"; $statusBar=ereg_replace("___articlesToApproveIcon___","$atpIcon",$statusBar); // Form to edit metadata $project = new Project(getProject()); global $metadataArticle; if(!$metadataArticle) { $col=$project->addCollection("metadata"); $metadataArticle = $col->lastArticleID+1; } $div = ""; if($metadataArticle>0) { $inputValueTitle=$project->getField("metadata", $metadataArticle, "title", "nolorem"); $inputValueKeywords=$project->getField("metadata", $metadataArticle, "keywords", "nolorem"); $inputValueDescription=$project->getField("metadata", $metadataArticle, "description", "nolorem"); } $inputValueTitleDef=$project->getField("metadata", 1, "title", "nolorem"); $inputValueKeywordsDef=$project->getField("metadata", 1, "keywords", "nolorem"); $inputValueDescriptionDef=$project->getField("metadata", 1, "description", "nolorem"); $div .= "
Metadata
"; $div .= "
For this page:


Title:
Keywords:
Description:


Site default:



Title:
Keywords:
Description:


"; $statusBar = ereg_replace("",$div,$statusBar); } if(ereg("",$pageContent))$pageContent=ereg_replace("",$statusBar,$pageContent); if(ereg("",$pageContent))$pageContent=ereg_replace("",$header,$pageContent); if(isset($_REQUEST['dgImage'])) { $img=""; $pageContent=ereg_replace("\<\/body\>","$img",$pageContent); } if(IS_BO) { // Add Backoffice article's context menu to DOM $menuArticles=""; if (isset($_COOKIE[TIME_MACHINE_COOKIE])) { $tm_time = date('d-m-Y H:i', $_COOKIE[TIME_MACHINE_COOKIE]); $menuArticles .= ""; } $pageContent=ereg_replace("\<\/body\>",$menuArticles.createWorkflowMenu()."",$pageContent); // PageComposer stuff if($_COOKIE['pagecomposer']==1) { $stuff .= ""; $stuff .= ""; $stuff .= "\n\n"; $stuff .= '

The module will be permanently deleted and cannot be recovered. Are you sure?

'; } $stuff.=''; $pageContent = ereg_replace("\<\/body\>", $stuff . "", $pageContent); } // Check ioncube license /* $props = ioncube_license_properties(); if (!IS_BO && $props['type']['value'] !== 'full') { $ss3adbanner = ""; $pageContent=ereg_replace("\<\/body\>",$ss3adbanner."",$pageContent); } */ // is there any content to render ? if(isset($pageContent)) { $tmp=ereg_replace("/","",strrchr($object,"/")); $objFile=substr($tmp, 0, strrpos($tmp, '.')); if(file_exists(MAIN_DIR."/css/".$objFile.".css")) { $pageContent=ereg_replace("","",$pageContent); } $contentEval=evalPHP($pageContent); if(!IS_BO && $_SERVER["REQUEST_METHOD"]!="POST" && !$_REQUEST['nocache']) { saveStaticCache($object,$queryStr,$contentEval); //saveStaticCache($object,$queryStr,$pageContent); } // Output Page print $contentEval; if (is_benchmark()) { print("\n"); foreach ($benchmark_objects as $bm_obj) { if ($bm_obj->is_visible() === false) print "\n"; else print "\n"; } } } exit; } // No content to render header("Location:".getMyURL(404)); //print "

WRONG URL !!!!

"; ?>