Index: trunk/admin/category/category_maint.php =================================================================== diff -u -r305 -r375 --- trunk/admin/category/category_maint.php (.../category_maint.php) (revision 305) +++ trunk/admin/category/category_maint.php (.../category_maint.php) (revision 375) @@ -69,10 +69,19 @@ $section = "in-portal:category_maint"; +//echo "In MaintScript
"; +//flush(); +//die(); + $CatsPerLoad = 10; $ado = GetADODBConnection(); -if(!is_numeric($_GET["CatIndex"])) + +// init vars +if( !isset($NumCats) ) $NumCats = 0; +if( !isset($CatIndex) ) $CatIndex = 0; + +if( !is_numeric($_GET["CatIndex"]) ) { unset($objEditItems); @@ -97,49 +106,38 @@ } $NumCats = TableCount($table,"",0); } - -// init vars -if( !isset($NumCats) ) $NumCats = 0; -if( !isset($CatIndex) ) $CatIndex = 0; -if(is_numeric($_GET["CatIndex"])) +elseif( is_numeric($_GET["CatIndex"]) ) { $NumCats = $_REQUEST['NumCats']; $CatIndex = (int)$_REQUEST['CatIndex']; $table = ($objCatList->CurrentCategoryID() > 0) ? $objSession->GetEditTable("Category") : $objCatList->SourceTable; //echo $NumCats." Loaded
\n"; $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories"); $title .= " $CatIndex / $NumCats ".prompt_language("la_Text_complete"); -} -else - $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories"); + int_header(NULL,NULL,$title); + flush(); -$sql = "SELECT * FROM $table ORDER BY ParentPath ASC LIMIT $CatIndex,$CatsPerLoad"; -$start = getmicrotime(); + $sql = "SELECT * FROM $table ORDER BY ParentPath ASC LIMIT $CatIndex,$CatsPerLoad"; -//echo $sql."
\n"; -$objCatList->Query_Item($sql); -//echo getmicrotime() - $start." QUERY ".$x."
\n"; -$x = 0; - -foreach($objCatList->Items as $cat) -{ - // echo getmicrotime() - $start." START ".$x."
\n"; - $cat->UpdateACL(); - // echo getmicrotime() - $start." ACL ".$x."
\n"; - $cat->UpdateCachedPath(); - // echo getmicrotime() - $start." PATH ".$x."
\n"; - $x++; - // echo "
\n"; - // echo $cat->Get("ParentPath")."
\n"; - // $cat->UpdateCacheCounts(); - // $objSystemCache->PurgeCategory($cat->Get("CategoryId")); + $objCatList->Query_Item($sql); + foreach($objCatList->Items as $cat) + { + $cat->UpdateACL(); + $cat->UpdateCachedPath(); + } } +else +{ + $title = prompt_language("la_prompt_updating")." ".prompt_language("la_Text_Categories"); + int_header(NULL,NULL,$title); + flush(); +} $no_url = $adminURL.'/'.$objSession->GetVariable('ReturnScript').'?env='.BuildEnv(); $yes_url = $_SERVER['PHP_SELF'].'?env='.BuildEnv().'&CatIndex=0&NumCats='.$NumCats; $cat_update = $objSession->GetVariable('PermCache_UpdateRequired'); -int_header(NULL,NULL,$title); + ?>