0) { if($GLOBALS["GP_pageid_fail"] != "") { $strIdPage = $GLOBALS["GP_pageid_fail"]; } else { $strIdPage = $GLOBALS["GP_pageid_source"]; } } if(isset($HTTP_GET_VARS["catid"])) $GLOBALS["GP_catid"] = $HTTP_GET_VARS["catid"]; elseif (isset($HTTP_POST_VARS["catid"])) $GLOBALS["GP_catid"] = $HTTP_POST_VARS["catid"]; else $GLOBALS["GP_catid"] = strGetHomeCat(); //echo "Debug:".$GLOBALS["GP_catid"]; // FORUM MODULE variables if(isset($HTTP_GET_VARS["frmid"])) $GLOBALS["GP_frmid"] = $HTTP_GET_VARS["frmid"]; elseif (isset($HTTP_POST_VARS["frmid"])) $GLOBALS["GP_frmid"] = $HTTP_POST_VARS["frmid"]; else $GLOBALS["GP_frmid"] = ""; if(isset($HTTP_GET_VARS["frtid"])) $GLOBALS["GP_frtid"] = $HTTP_GET_VARS["frtid"]; elseif (isset($HTTP_POST_VARS["frtid"])) $GLOBALS["GP_frtid"] = $HTTP_POST_VARS["frtid"]; else $GLOBALS["GP_frtid"] = ""; if(isset($HTTP_GET_VARS["frpid"])) $GLOBALS["GP_frpid"] = $HTTP_GET_VARS["frpid"]; elseif (isset($HTTP_POST_VARS["frpid"])) $GLOBALS["GP_frpid"] = $HTTP_POST_VARS["frpid"]; else $GLOBALS["GP_frpid"] = ""; if(isset($HTTP_GET_VARS["blk"])) $GLOBALS["GP_blk"] = $HTTP_GET_VARS["blk"]; elseif (isset($HTTP_POST_VARS["blk"])) $GLOBALS["GP_blk"] = $HTTP_POST_VARS["blk"]; else $GLOBALS["GP_blk"] = ""; if(isset($HTTP_GET_VARS["sblk"])) $GLOBALS["GP_sblk"] = $HTTP_GET_VARS["sblk"]; elseif (isset($HTTP_POST_VARS["sblk"])) $GLOBALS["GP_sblk"] = $HTTP_POST_VARS["sblk"]; else $GLOBALS["GP_sblk"] = ""; $GLOBALS["g_strUsrAccess"] = nGetUserAccess(); $result = dbExecute("select * from ".$GLOBALS["vsCmsPrefix"]."pages where pgName='".$strIdPage."'", true); if($rs = dbFetch($result)) { if(!bCheckPageAccess($rs["pgAccess"])) { $strNoAccessPageId = $rs["pgNoAccessPage"]; if($strNoAccessPageId != "") { dbFreeResult($result); $result = dbExecute("select * from ".$GLOBALS["vsCmsPrefix"]."pages where pgName='".$strNoAccessPageId."'", true); if($rs = dbFetch($result)) { $strIdPage = $strNoAccessPageId; $strTemplate = $rs["pgCode"]; } else { echo userError("The (no access) page ".$strNoAccessPageId." does not exist!", true); dbFreeResult($result); exit(); } } else { $strTemplate = $rs["pgCode"]; } } else { $strTemplate = $rs["pgCode"]; } } else { echo userError("The page ".$strIdPage." does not exist!", true); dbFreeResult($result); exit(); } dbFreeResult($result); // Find all blocks that are used in a page. The code below also checks if there are parsing errors. $arBlocks = splitBlocks($strTemplate, "%", true); // When no %tags% are present just show it as it is. $strPage = $strTemplate; // All the blocks that are used are stored in $arBlocks array. Below we explode the blocks on a page. foreach ($arBlocks as $strBlockName) { $blocks = explode("[%".$strBlockName."%]", $strTemplate); $count = count($blocks); $i = 0; $strPage = ""; foreach ($blocks as $block) { $strPage .= $block; $i++; if ($i >= $count) break; // Include the correct file $strProt = findProtoype($strBlockName, $GLOBALS["nBlockAccess"]); // DEBUG: echo "prototypes/".$strProt.".php, blockname=$strBlockName
"; if($strProt <> "") include("prototypes/".$strProt.".php"); else $strPage .= userError("No such block"); } $strTemplate = $strPage; } /////////////////////////////////////////////////////////////////////////// // Parse the blocks inside contents or other blocks! // Find all blocks that are used in a page. The code below also checks if there are parsing errors. $arBlocks = splitBlocks($strTemplate, "%", true); // When no %tags% are present just show it as it is. $strPage = $strTemplate; // All the blocks that are used are stored in $arBlocks array. Below we explode the blocks on a page. foreach ($arBlocks as $strBlockName) { $blocks = explode("[%".$strBlockName."%]", $strTemplate); $count = count($blocks); $i = 0; $strPage = ""; foreach ($blocks as $block) { $strPage .= $block; $i++; if ($i >= $count) break; // Include the correct file $strProt = findProtoype($strBlockName, $GLOBALS["nBlockAccess"]); if($strProt <> "") include("prototypes/".$strProt.".php"); else $strPage .= userError("No such block"); } $strTemplate = $strPage; } /////////////////////////////////////////////////////////////////////////// // Parse global variables inside a page $strHtmlCode = $strPage; $arVars = splitBlocks($strHtmlCode, "$", true); foreach ($arVars as $strVarName) { $blocks2 = explode("[$".$strVarName."$]", $strHtmlCode); $count2 = count($blocks2); $i2 = 0; $strBlock = ""; foreach ($blocks2 as $block2) { $strBlock .= $block2; $i2++; if ($i2 >= $count2) break; include("./prototypes/process/globalvalues.php"); //if(!$bVarFound) // $strBlock .= userError("[$".$strVarName."$] : No such variable"); } $strHtmlCode = $strBlock; } $strPage = $strHtmlCode; /////////////////////////////////////////////////////////////////////////// if($GLOBALS["strDesignErrors"] != "") echo $GLOBALS["strDesignErrors"]; echo $strPage; if($GLOBALS["GP_refreshframes"] == "1") { ?> ".chr(13); else echo chr(13)."".chr(13); //End_Timer(); ?>