<?php
require 'adminstart.php';
require '../classes/comments.php';
if ($thismember->isadmin())
{
if ($filled)
{
if (($next == '') || ($next < 1)) $next = 0;
if ($inc < 1) $inc = 10;
if ($action == 'links')
{
$query = $db->select('id', 'linkstable', 'id>0', '', '');
$num = $db->numrows($query);
updatelinkcounters($next);
$next += $inc;
$template = new template("../$templatesdir/redirect.tpl");
if ($next < ($num + $inc))
{
$template->replace('{MESSAGE}', "Updating next $inc entries starting at $next ...");
$template->replace('{DESTINATION}', "updatecounters.php?filled=1&action=links&next=$next&inc=$inc");
}
else
{
$template->replace('{MESSAGE}', "All entries have been updated, we're done.");
$template->replace('{DESTINATION}', "updatecounters.php");
}
}
else if ($action == 'members')
{
$query = $db->select('id', 'memberstable', 'id>0', '', '');
$num = $db->numrows($query);
updatememcounters($next);
$next += $inc;
$template = new template("../$templatesdir/redirect.tpl");
if ($next < ($num + $inc))
{
$template->replace('{MESSAGE}', "Updating next $inc members starting at $next ...");
$template->replace('{DESTINATION}', "updatecounters.php?filled=1&action=members&next=$next&inc=$inc");
}
else
{
$template->replace('{MESSAGE}', "All members have been updated, we're done.");
$template->replace('{DESTINATION}', "updatecounters.php");
}
}
}
else
{
$template = new template("../$templatesdir/admin/updatecounters.tpl");
}
}
require 'adminend.php';
?>