Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F805068
inp1_parser.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Feb 26, 10:34 PM
Size
5 KB
Mime Type
text/x-php
Expires
Fri, Feb 28, 10:34 PM (6 h, 4 m)
Engine
blob
Format
Raw Data
Handle
577335
Attached To
rINP In-Portal
inp1_parser.php
View Options
<?php
class
Inp1Parser
extends
kBase
{
var
$InportalInited
=
false
;
function
Parse
(
$tname
,
$template_body
)
{
if
(
!
$this
->
InportalInited
)
{
$this
->
InitInPortal
();
}
global
$objTemplate
;
$template_body
=
$objTemplate
->
ParseTemplateFromBuffer
(
$tname
,
$template_body
);
return
$template_body
;
}
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,
$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
,
$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
,
$pathchar
,
$objTemplate
;
$pathtoroot
=
"./"
;
$pathtoroot
=
realpath
(
$pathtoroot
).
"/"
;
if
(!
file_exists
(
$pathtoroot
.
"config.php"
))
{
echo
"In-Portal is probably not installed, or configuration file is missing.<br>"
;
echo
"Please use the installation script to fix the problem.<br><br>"
;
echo
"<a href='admin/install.php'>Go to installation script</a><br><br>"
;
flush
();
die
();
}
//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 = "https://".ThisDomain().$objConfig->Get("Site_Path");
$secureURL
=
$rootURL
;
$html
=
''
;
if
(
!
$var_list
[
't'
]
)
$var_list
[
't'
]
=
'index'
;
if
(
!
isset
(
$CurrentTheme
)
)
$CurrentTheme
=
null
;
if
(
!
is_object
(
$CurrentTheme
)
)
$CurrentTheme
=
$objThemes
->
GetItem
(
$m_var_list
[
"theme"
]);
if
(
is_object
(
$CurrentTheme
))
{
if
(!
$CurrentTheme
->
Get
(
"Enabled"
))
{
$CurrentTheme
=
$objThemes
->
GetItem
(
$objThemes
->
GetPrimaryTheme
());
}
if
((
int
)
$CurrentTheme
->
Get
(
"ThemeId"
)>
0
)
{
$timeout
=
$CurrentTheme
->
Get
(
"CacheTimeout"
);
$objLanguageCache
->
LoadTemplateCache
(
$var_list
[
"t"
],
$timeout
,
$CurrentTheme
->
Get
(
"ThemeId"
));
$objLanguageCache
->
LoadCachedVars
(
$objSession
->
Get
(
"Language"
));
$TemplateRoot
=
$CurrentTheme
->
ThemeDirectory
().
"/"
;
$objTemplate
=
new
clsTemplateList
(
$TemplateRoot
);
//$html = $objTemplate->ParseTemplate($var_list["t"]);
}
else
{
echo
"No Primary Theme Selected"
;
die
();
}
}
else
{
echo
"No Primary Theme Selected
\n
"
;
die
();
}
if
(
is_object
(
$objSession
))
{
$objSession
->
SetVariable
(
"Template_Referer"
,
$_local_t
);
}
if
(
$objTemplate
->
ErrorNo
==
-
1
)
{
$html
=
$objTemplate
->
ParseTemplate
(
'error_template'
);
}
//$html = replacePngTags($html);
LogEntry
(
"Output Start
\n
"
);
$html
.=
"<!-- Page Execution Time: "
.(
isset
(
$ptime
)
?
$ptime
:
0
).
" -->"
;
if
(
IsDebugMode
()
)
{
if
(
$Action
)
$debugger
->
setHTMLByIndex
(
1
,
'Front Action: <b>'
.
$Action
.
'</b>'
,
'append'
);
$html
=
'<a href="javascript:toggleDebugLayer();">Show Debugger</a><br>'
.
$html
;
}
else
{
header
(
"Content-length: "
.
strlen
(
$html
));
}
header
(
"Connection-Type: Keep-Alive"
);
echo
$html
;
LogEntry
(
"Output End
\n
"
);
if
(
isset
(
$template
)
&&
$template
->
ErrorNo
!=
0
)
{
print
"
\n
("
.
$objTemplate
->
ErrorNo
.
") "
.
$objTemplate
->
ErrorStr
.
"
\n
"
;
}
LogEntry
(
"Output Complete
\n
"
);
$objLanguageCache
->
SaveTemplateCache
();
LogEntry
(
"Templates Cached
\n
"
);
//if($objSession->SessionEnabled())
// $objSession->SaveSessionData();
//echo "Cookie: <PRE>"; print_r($_COOKIE); echo "</PRE><br>\n";
//ob_end_flush();
$timeend
=
getmicrotime
();
$diff
=
$timeend
-
$timestart
;
LogEntry
(
"
\n
Total Queries Executed: $sqlcount in $totalsql seconds
\n
"
);
LogEntry
(
"
\n
Page Execution Time: $diff seconds
\n
"
,
true
);
if
(
$LogFile
)
fclose
(
$LogFile
);
}
}
?>
Event Timeline
Log In to Comment