Index: trunk/admin/category/category_maint.php =================================================================== diff -u -r2611 -r2853 --- trunk/admin/category/category_maint.php (.../category_maint.php) (revision 2611) +++ trunk/admin/category/category_maint.php (.../category_maint.php) (revision 2853) @@ -13,57 +13,15 @@ ## privileges along maximum prosecution allowed by law. ## ############################################################## if(!defined('CACHE_PERM_CHUNK_SIZE'))define('CACHE_PERM_CHUNK_SIZE',30); - -if( !(isset($pathtoroot) && $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 - if( !isset($pathtoroot) ) $pathtoroot = ''; - 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; - define('REDIRECT_REQUIRED',1); // this script can issue redirect header -require_once($pathtoroot."kernel/startup.php"); +// new startup: begin +define('REL_PATH', 'admin/category'); +$relation_level = count( explode('/', REL_PATH) ); +define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) ); +require_once FULL_PATH.'/kernel/startup.php'; +// new startup: end -//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");