Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Sun, Feb 2, 3:53 AM

in-portal

Index: trunk/admin/category/category_maint.php
===================================================================
--- trunk/admin/category/category_maint.php (revision 667)
+++ trunk/admin/category/category_maint.php (revision 668)
@@ -1,166 +1,166 @@
<?php
##############################################################
##In-portal ##
##############################################################
## In-portal ##
## Intechnic Corporation ##
## All Rights Reserved, 1998-2002 ##
## ##
## No portion of this code may be copied, reproduced or ##
## otherwise redistributed without proper written ##
## consent of Intechnic Corporation. Violation will ##
## result in revocation of the license and support ##
## privileges along maximum prosecution allowed by law. ##
##############################################################
if(!defined('CACHE_PERM_CHUNK_SIZE'))define('CACHE_PERM_CHUNK_SIZE',30);
if(!strlen($pathtoroot))
{
$path = dirname(realpath(__FILE__));
if( strlen($path) )
{
// determine the OS type for path parsing
$pos = strpos($path, ':');
$gOS_TYPE = ($pos === false) ? 'unix' : 'win';
$pathchar = ($gOS_TYPE == 'unix') ? '/' : "\\";
$p = $path.$pathchar;
// Start looking for the root flag file
while( !strlen($pathtoroot) && strlen($p) )
{
$sub = substr($p, strlen($pathchar) * -1);
$filename = $p.( ($sub == $pathchar) ? '' : $pathchar).'root.flg';
if( !file_exists($filename) )
{
$parent = realpath($p.$pathchar."..".$pathchar);
$p = ($parent != $p) ? $parent : '';
}
else
$pathtoroot = $p;
}
if( !strlen($pathtoroot) ) $pathtoroot = '.'.$pathchar;
}
else
$pathtoroot = '.'.$pathchar;
}
$sub = substr($pathtoroot,strlen($pathchar)*-1);
if( $sub != $pathchar) $pathtoroot = $pathtoroot.$pathchar;
//echo $pathtoroot;
//$FrontEnd=2;
require_once($pathtoroot."kernel/startup.php");
//admin only util
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
$admin = $objConfig->Get("AdminDirectory");
if(!strlen($admin))
$admin = "admin";
$localURL=$rootURL."kernel/";
$adminURL = $rootURL.$admin;
$imagesURL = $adminURL."/images";
$pathtolocal = $pathtoroot."in-news/";
require_once ($pathtoroot.$admin."/include/elements.php");
require_once ($pathtoroot."kernel/admin/include/navmenu.php");
require_once ($pathtolocal."admin/include/navmenu.php");
require_once($pathtoroot.$admin."/toolbar.php");
require_once($pathtoroot.$admin."/listview/listview.php");
$section = "in-portal:category_maint";
require_once($pathtoroot.$admin."/category/permcacheupdate.php");
-
if(!$objSession->GetVariable('PermCache_UpdateRequired'))
+{
die(header('Location: '.$adminURL.'/'.$objSession->GetVariable('ReturnScript').'?env='.BuildEnv()));
-
+}
if(isset($_GET['continue']))
{
$updater =& new clsCacheUpdater(1);
if(!intval($_GET['continue']))
{
$updater->clearData();
die(header('Location: '.$adminURL.'/'.$objSession->GetVariable('ReturnScript').'?env='.BuildEnv()));
}
}
else
{
$updater =& new clsCacheUpdater();
$no_url = $_SERVER['PHP_SELF'].'?env='.BuildEnv().'&continue=0';
$yes_url = $_SERVER['PHP_SELF'].'?env='.BuildEnv().'&continue=1';
- $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
- int_header(NULL,NULL,$title);
- flush();
if(!isset($_GET['force']))
if($updater->totalCats > CACHE_PERM_CHUNK_SIZE)
{
$updater->setData();
+ $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
+ int_header(NULL,NULL,$title);
+ flush();
?>
<script language="javascript">
function goto_url(url)
{
document.location = url;
}
</script>
<table cellspacing="0" cellpadding="2" width="100%" border="0" class="tableborder">
<tr>
<td align="center" colspan="3" bgcolor="#FFFFFF"><?php echo prompt_language('la_confirm_maintenance'); ?></td>
</tr>
<tr>
<td align="center" colspan="3" bgcolor="#FFFFFF"><?php echo prompt_language('la_prompt_perform_now'); ?></td>
</tr>
<tr>
<td align="right" width="50%">
<input type="button" name="yes_btn" value="<?php echo admin_language("lu_yes"); ?>" onclick="javascript:goto_url('<?php echo $yes_url; ?>');" class="button">
</td>
<td><img src="<?php echo $imagesURL; ?>/spacer.gif" width="10"></td>
<td align="left" width="50%">
<input type="button" name="yes_btn" value="<?php echo admin_language("lu_no"); ?>" onclick="javascript:goto_url('<?php echo $no_url; ?>');" class="button">
</td>
</tr>
</table>
<?php
int_footer();
die();
}
}
$title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories");
int_header(NULL,NULL,$title);
flush();
$percent=$updater->getDonePercent();
echo '<TABLE cellspacing="0" cellpadding="2" width="100%" border="0" class="tableborder">';
if ($percent == 0)
echo '<TR><TD BGCOLOR="#FFFFFF" width="100%" >'.$percent.'%</td></TR>';
else if ($percent < 60)
echo '<TR><TD BGCOLOR="#4682B2" width="'.$percent.'%"></td><TD BGCOLOR="#FFFFFF" width="'.(100-$percent).'%">'.$percent.'%</td></TR>';
else if ($percent == 100)
echo '<TR><TD BGCOLOR="#4682B2" align="right" width="100%"><FONT COLOR="#FFFFFF">'.$percent.'%</FONT></td>';
else
echo '<TR><TD BGCOLOR="#4682B2" align="right" width="'.$percent.'%"><FONT COLOR="#FFFFFF">'.$percent.'%</FONT></td><TD BGCOLOR="#FFFFFF" width="'.(100-$percent).'%"></td></TR>';
echo '</TABLE>';
flush();
$needs_more = TRUE;
while ($needs_more && $updater->iteration < CACHE_PERM_CHUNK_SIZE) {
$needs_more = $updater->DoTheJob();
}
if ($needs_more)
{
$updater->setData();
$url=$adminURL.'/category/category_maint.php?env='.BuildEnv().'&continue=1';
}
else
{
$updater->clearData();
$url = $adminURL.'/'.$objSession->GetVariable('ReturnScript').'?env='.BuildEnv();
$objSession->SetVariable('PermCache_UpdateRequired', 0);
}
print "<script language=\"javascript\">" ;
-print "setTimeout(\"document.location='$url';\",40);";
+print "setTimeout(\"document.location='$url';\",400);";
print "</script>";
int_footer();
exit;
?>
\ No newline at end of file
Property changes on: trunk/admin/category/category_maint.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.17
\ No newline at end of property
+1.18
\ No newline at end of property
Index: trunk/index.php
===================================================================
--- trunk/index.php (revision 667)
+++ trunk/index.php (revision 668)
@@ -1,129 +1,128 @@
<?php
if( file_exists('debug.php') ) include_once('debug.php');
if( defined('DEBUG_MODE') )
{
ini_set('error_prepend_string','<span class="debug_text">');
- //ini_set('error_prepend_string','<script>function _(){alert(1);s="";var d=document.getElementById("dbg");for(var i=0;i<d.length;i++)s+=d[i].innerText;if(s!="")alert(s)} document.onload=_</script><span id=dbg style="display:none">');
ini_set('error_append_string','</span>');
}
else
error_reporting(0);
list($usec, $sec) = explode(" ",microtime());
$timestart = (float)$usec + (float)$sec;
$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();
+//ob_start();
$FrontEnd=1;
$indexURL="../../index.php"; //Set to relative URL from the theme directory
/* initalize the in-portal system */
include_once("kernel/startup.php");
LogEntry("System Init Complete\n");
/* load the current front-end language set */
//$objLanguageCache->LoadLanguage($objSession->Get("Language"),0);
$rootURL="http://".ThisDomain().$objConfig->Get("Site_Path");
//$secureURL = "https://".ThisDomain().$objConfig->Get("Site_Path");
$secureURL = $rootURL;
$html="<HTML>No Template</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"));
LogEntry("Language Set Loaded\n");
$TemplateRoot = $CurrentTheme->ThemeDirectory()."/";
// echo "Template Root: $TemplateRoot<br>\n";
LogEntry("Parsing Templates in $TemplateRoot\n");
$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()) 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();
+//ob_end_flush();
$timeend = getmicrotime();
$diff = $timeend - $timestart;
LogEntry("\nTotal Queries Executed: $sqlcount in $totalsql seconds\n");
LogEntry("\nPage Execution Time: $diff seconds\n", true);
if($LogFile)
fclose($LogFile);
?>
Property changes on: trunk/index.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.5
\ No newline at end of property
+1.6
\ No newline at end of property

Event Timeline