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"; $CatsPerLoad = 10; $ado = GetADODBConnection(); if(!is_numeric($_GET["CatIndex"])) { unset($objEditItems); $objEditItems = new clsCatList(); $objEditItems->SourceTable = $objSession->GetEditTable("Category"); $table = $objEditItems->SourceTable; //echo "Dropping Table..
\n"; @$ado->Execute("DROP TABLE $table"); if($objCatList->CurrentCategoryID()>0) { $c = $objCatList->GetItem($objCatList->CurrentCategoryID()); $path = $c->Get("ParentPath"); $sql = "SELECT CategoryId,ParentPath FROM ".$objCatList->SourceTable." WHERE ParentPath LIKE '".$path."%'"; $ado->Execute("CREATE TABLE $table ".$sql); } else { $sql = "SELECT CategoryId,ParentPath FROM ".$objCatList->SourceTable; $objEditTable->SourceTable = $objCatList->SourceTable; $table = $objCatList->SourceTable; } $NumCats = TableCount($table,"",0); } // init vars if( !isset($NumCats) ) $NumCats = 0; if( !isset($CatIndex) ) $CatIndex = 0; if(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"); $sql = "SELECT * FROM $table ORDER BY ParentPath ASC LIMIT $CatIndex,$CatsPerLoad"; $start = getmicrotime(); //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")); } int_header(NULL,NULL,$title); ?> $CatsPerLoad) { int_subsection_title(prompt_language("la_confirm_maintenance")); $yes_url = $_SERVER['PHP_SELF'].'?env='.BuildEnv().'&CatIndex=0&NumCats='.$NumCats; $no_url = $adminURL.'/browse.php?env='.BuildEnv(); ?>
" onclick="javascript:goto_url('');" class="button"> " onclick="javascript:goto_url('');" class="button">
"; echo "$percent"; echo "%"; } else if ($percent < 60) { echo ""; $row2 = 100-$percent; echo " $percent"; echo "%"; } else if ($percent == 100) { echo "$percent%"; } else { echo "$percent%"; $row2 = 100-$percent; echo " "; } } flush(); ?> $NumCats) { $target = $adminURL."/".$objSession->GetVariable('ReturnScript').'?env='.BuildEnv(); //$adminURL."/browse.php?env=".BuildEnv(); } else { $next = $CatIndex+$CatsPerLoad; if($next > $NumCats) { $target = $adminURL."/".$objSession->GetVariable('ReturnScript').'?env='.BuildEnv(); //$adminURL."/browse.php?env=".BuildEnv(); } else $target = $_SERVER["PHP_SELF"]."?env=".BuildEnv()."&CatIndex=".$next."&NumCats=$NumCats"; } //print "$target"; print ""; ?>