Index: branches/unlabeled/unlabeled-1.16.2/core/units/general/inp1_parser.php =================================================================== diff -u -r7750 -r7944 --- branches/unlabeled/unlabeled-1.16.2/core/units/general/inp1_parser.php (.../inp1_parser.php) (revision 7750) +++ branches/unlabeled/unlabeled-1.16.2/core/units/general/inp1_parser.php (.../inp1_parser.php) (revision 7944) @@ -1,15 +1,26 @@ InportalInited) { + $this->InitInPortal(); + } + // in case Parsing was called through InitInPortal -> moudles -> frontaction -> emailevent + // we need to make sure old parser is initialized + $this->InitParser(); + $template_body = $objTemplate->ParseTemplateFromBuffer($tname, $template_body); + return $template_body; + } + if ( !$this->InportalInited) { //$save_t = $this->Application->GetVar('t'); $this->InitInPortal(); @@ -19,13 +30,13 @@ $get = $_GET; unset($get['env'], $get['Action'], $get['_mod_rw_url_'], $get['rewrite']); $this->Application->StoreVar('K4_Template_Referer', $this->Application->GetVar('t') ); - + $this->Application->Redirect($var_list['t'], $get); } } - + $var_list['t'] = $this->cutTPL($var_list['t']); - + if ($var_list['t'] != $this->Application->GetVar('t')) { //$var_list['t'] = rtrim($var_list['t'],'.tpl'); $t = $var_list['t']; @@ -39,7 +50,7 @@ } return $template_body; } - + function cutTPL($tname) { if( substr($tname,-4) == '.tpl' ) @@ -48,80 +59,80 @@ } return $tname; } - + function InitParser() { global $objTemplate, $CurrentTheme, $objThemes, $objLanguageCache, $var_list; if ($this->InpParsetInited) return true; - + $theme_id = $this->Application->IsAdmin() ? 1 : $this->Application->GetVar('m_theme'); if ($theme_id) { $CurrentTheme = $objThemes->GetItem($theme_id); - + $timeout = $CurrentTheme->Get('CacheTimeout'); $objLanguageCache->LoadTemplateCache($var_list['t'], $timeout, $theme_id); $objLanguageCache->LoadCachedVars($this->Application->GetVar('m_lang')); - + $objTemplate = new clsTemplateList(FULL_PATH.THEMES_PATH.'/'); } - + $this->InpParsetInited = true; } - + function InitInPortal() { $this->InportalInited = true; - /*global $pathtoroot, $FrontEnd, $indexURL, $rootURL, $secureURL, $var_list, $CurrentTheme, - $objThemes, $objConfig, $m_var_list, $timeout, $objLanguages, $objLanguageCache, - $TemplateRoot, $objTemplate, $html, $objSession, $Errors, $objCatList, $objUsers, + /*global $pathtoroot, $FrontEnd, $indexURL, $rootURL, $secureURL, $var_list, $CurrentTheme, + $objThemes, $objConfig, $m_var_list, $timeout, $objLanguages, $objLanguageCache, + $TemplateRoot, $objTemplate, $html, $objSession, $Errors, $objCatList, $objUsers, $env, $mod_prefix, $ExtraVars, $timestart, $timeend, $timeout, $sqlcount, $totalsql, $template_path, $modules_loaded, $mod_root_cats, $objModules, $objItemTypes;*/ - - - global $sec, $usec, $timestart, $pathtoroot, $FrontEnd, $indexURL, $kernel_version, $FormError, - $FormValues, $ItemTables, $KeywordIgnore, $debuglevel, - $LogLevel, $LogFile, $rq_value, $rq_name, $dbg_constMap, $dbg_constValue, $dbg_constName, - $debugger, $g_LogFile, $LogData, $Errors, - $g_DebugMode, $totalsql, $sqlcount, $objConfig, $ItemTypePrefixes, $ItemTagFiles, $objModules, + + + global $sec, $usec, $timestart, $pathtoroot, $FrontEnd, $indexURL, $kernel_version, $FormError, + $FormValues, $ItemTables, $KeywordIgnore, $debuglevel, + $LogLevel, $LogFile, $rq_value, $rq_name, $dbg_constMap, $dbg_constValue, $dbg_constName, + $debugger, $g_LogFile, $LogData, $Errors, + $g_DebugMode, $totalsql, $sqlcount, $objConfig, $ItemTypePrefixes, $ItemTagFiles, $objModules, $objSystemCache, $objBanList, $objItemTypes, $objThemes, $objLanguages, $objImageList, $objFavorites, - $objUsers, $objGroups, $DownloadId, $objPermissions, $objPermCache, $m_var_list, $objCatList, - $objCustomFieldList, $objCustomDataList, $objCountCache, $CRLF, $objMessageList, $objEmailQueue, - $ExtraVars, $adodbConnection, $sql, $rs, $mod_prefix, $modules_loaded, $name, - $template_path, $mod_root_cats, $value, $mod, $ItemTypes, - $ParserFiles, $SessionQueryString, $var_list, $objSession, - $orderByClause, $TemplateRoot, $ip, $UseSession, $Action, $CookieTest, $sessionId, - $var_list_update, $CurrentTheme, $UserID, $objCurrentUser, $objLanguageCache, - $folder_name, $objLinkList, $tag_override, $timeZones, $siteZone, $serverZone, - $lastExpire, $diffZone, $date, $nowDate, $lastExpireDate, $SearchPerformed, - $TotalMessagesSent, $ado, $adminDir, $rootURL, $secureURL, $html, $timeout, + $objUsers, $objGroups, $DownloadId, $objPermissions, $objPermCache, $m_var_list, $objCatList, + $objCustomFieldList, $objCustomDataList, $objCountCache, $CRLF, $objMessageList, $objEmailQueue, + $ExtraVars, $adodbConnection, $sql, $rs, $mod_prefix, $modules_loaded, $name, + $template_path, $mod_root_cats, $value, $mod, $ItemTypes, + $ParserFiles, $SessionQueryString, $var_list, $objSession, + $orderByClause, $TemplateRoot, $ip, $UseSession, $Action, $CookieTest, $sessionId, + $var_list_update, $CurrentTheme, $UserID, $objCurrentUser, $objLanguageCache, + $folder_name, $objLinkList, $tag_override, $timeZones, $siteZone, $serverZone, + $lastExpire, $diffZone, $date, $nowDate, $lastExpireDate, $SearchPerformed, + $TotalMessagesSent, $ado, $adminDir, $rootURL, $secureURL, $html, $timeout, $pathchar, $objTemplate, $objTopicList, $objArticleList, $objPostingList, $objCensorList, $objSmileys, $objPMList, $SubscribeAddress, $SubscribeError, $SubscribeResult, $application; - + $pathtoroot = FULL_PATH.'/'; - + if (!file_exists(FULL_PATH.'/config.php')) { echo "In-Portal is probably not installed, or configuration file is missing.
"; echo "Please use the installation script to fix the problem.

"; echo "Go to installation script

"; flush(); $this->Application->ApplicationDie(); } - + //ob_start(); $FrontEnd = 1; - + $indexURL="../../index.php"; //Set to relative URL from the theme directory - + /* initalize the in-portal system */ include_once(FULL_PATH."/kernel/startup.php"); - + $rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); $secureURL = $rootURL; - + if( !$var_list['t'] ) $var_list['t'] = 'index'; - + $this->InitParser(); - + // process referer in session: begin if (is_object($objSession)) { $k4_referer = $objSession->GetVariable('K4_Template_Referer'); @@ -132,18 +143,18 @@ $objSession->SetVariable('Template_Referer', isset($_local_t) ? $_local_t : ''); } // process referer in session: end - + if ($this->Application->isDebugMode() && $Action) { $this->Application->Debugger->setHTMLByIndex(1, 'Front Action: '.$Action.'', 'append'); } - + LogEntry("Output Complete\n"); $objLanguageCache->SaveTemplateCache(); LogEntry("Templates Cached\n"); - + $timeend = getmicrotime(); $diff = $timeend - $timestart; - + LogEntry("\nTotal Queries Executed: $sqlcount in $totalsql seconds\n"); LogEntry("\nPage Execution Time: $diff seconds\n", true); if ($LogFile) {