Example #1
0
function recount($method, $cat_id)
{
    $database =& JFactory::getDBO();
    echo "<center><strong>" . JText::_('Please wait recount in progress') . "</strong>";
    if ($method == "fast") {
        fast_update_cats_and_links_count($cat_id);
    } else {
        $retval = update_cats_and_links_count($cat_id, true, true);
        $database->setQuery('UPDATE #__mt_cats SET cat_cats = ' . $database->quote($retval["cats"]) . ', cat_links = ' . $database->quote($retval["links"]) . ' WHERE cat_id = ' . $database->quote($cat_id));
        $database->query();
    }
    echo '<p /><strong>' . JText::_('Done') . '</strong><p /><input type="button" class="button" value="' . JText::_('Close this window') . '" onclick="window.close();" /></center>';
}
Example #2
0
     $tree->rebuild(0, 1);
     $database->setQuery("SELECT MAX(rgt) FROM #__mt_cats");
     $max_rgt = $database->loadResult();
     $database->setQuery("UPDATE #__mt_cats SET rgt = " . ($max_rgt + 1) . ", lft=1 WHERE cat_id = 0 OR cat_parent = -1");
     $database->query();
     break;
     /***
      * Global Update
      */
 /***
  * Global Update
  */
 case "globalupdate":
     $cache->clean();
     require_once $mtconf->getjconf('absolute_path') . '/administrator/components/com_mtree/recount.mtree.php';
     update_cats_and_links_count(0, true, true);
     $mainframe->redirect("index2.php?option={$option}&task=listcats&cat_id=0", JText::_('Cat and listing count updated'));
     break;
     /***
      * Geocode
      */
 /***
  * Geocode
  */
 case "geocode":
     require_once $mtconf->getjconf('absolute_path') . '/administrator/components/com_mtree/geocode.mtree.php';
     break;
     /***
      * Recount
      */
 /***