Vergleich admin/modules/tools/recount_rebuild.php - 1.8.10 - 1.8.26

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 30Zeile 30

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('forumcounters', MyBB::INPUT_INT);


$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('forumcounters', MyBB::INPUT_INT);

	if($per_page <= 0)
{
$per_page = 50;
}






	$start = ($page-1) * $per_page;
$end = $start + $per_page;


	$start = ($page-1) * $per_page;
$end = $start + $per_page;


Zeile 46Zeile 43
	}

check_proceed($num_forums, $end, ++$page, $per_page, "forumcounters", "do_rebuildforumcounters", $lang->success_rebuilt_forum_counters);

	}

check_proceed($num_forums, $end, ++$page, $per_page, "forumcounters", "do_rebuildforumcounters", $lang->success_rebuilt_forum_counters);

}


}


/**
* Rebuild thread counters
*/

/**
* Rebuild thread counters
*/

Zeile 60Zeile 57

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('threadcounters', MyBB::INPUT_INT);


$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('threadcounters', MyBB::INPUT_INT);

	if($per_page <= 0)
{
$per_page = 500;
}
$start = ($page-1) * $per_page;
$end = $start + $per_page;


$start = ($page-1) * $per_page;
$end = $start + $per_page;





$query = $db->simple_select("threads", "tid", '', array('order_by' => 'tid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($thread = $db->fetch_array($query))
{
rebuild_thread_counters($thread['tid']);


$query = $db->simple_select("threads", "tid", '', array('order_by' => 'tid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($thread = $db->fetch_array($query))
{
rebuild_thread_counters($thread['tid']);

	}


	}


	check_proceed($num_threads, $end, ++$page, $per_page, "threadcounters", "do_rebuildthreadcounters", $lang->success_rebuilt_thread_counters);
}


	check_proceed($num_threads, $end, ++$page, $per_page, "threadcounters", "do_rebuildthreadcounters", $lang->success_rebuilt_thread_counters);
}


Zeile 88Zeile 82

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('pollcounters', MyBB::INPUT_INT);


$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('pollcounters', MyBB::INPUT_INT);

	if($per_page <= 0)
{
$per_page = 500;
}






	$start = ($page-1) * $per_page;
$end = $start + $per_page;

$query = $db->simple_select("polls", "pid", '', array('order_by' => 'pid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($poll = $db->fetch_array($query))

	$start = ($page-1) * $per_page;
$end = $start + $per_page;

$query = $db->simple_select("polls", "pid", '', array('order_by' => 'pid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($poll = $db->fetch_array($query))

	{

	{

		rebuild_poll_counters($poll['pid']);

		rebuild_poll_counters($poll['pid']);

	}


	}


	check_proceed($num_polls, $end, ++$page, $per_page, "pollcounters", "do_rebuildpollcounters", $lang->success_rebuilt_poll_counters);
}


	check_proceed($num_polls, $end, ++$page, $per_page, "pollcounters", "do_rebuildpollcounters", $lang->success_rebuilt_poll_counters);
}


Zeile 116Zeile 107

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('userposts', MyBB::INPUT_INT);


$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('userposts', MyBB::INPUT_INT);

	if($per_page <= 0)
{
$per_page = 500;
}






	$start = ($page-1) * $per_page;
$end = $start + $per_page;


	$start = ($page-1) * $per_page;
$end = $start + $per_page;


Zeile 170Zeile 158

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('userthreads', MyBB::INPUT_INT);


$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('userthreads', MyBB::INPUT_INT);

	if($per_page <= 0)
{
$per_page = 500;
}






	$start = ($page-1) * $per_page;
$end = $start + $per_page;


	$start = ($page-1) * $per_page;
$end = $start + $per_page;


Zeile 193Zeile 178
	else
{
$fids = "";

	else
{
$fids = "";

	}

	}


$query = $db->simple_select("users", "uid", '', array('order_by' => 'uid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($user = $db->fetch_array($query))


$query = $db->simple_select("users", "uid", '', array('order_by' => 'uid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($user = $db->fetch_array($query))

Zeile 204Zeile 189
			WHERE t.uid='{$user['uid']}' AND t.visible > 0 AND t.closed NOT LIKE 'moved|%'{$fids}
");
$num_threads = $db->fetch_field($query2, "thread_count");

			WHERE t.uid='{$user['uid']}' AND t.visible > 0 AND t.closed NOT LIKE 'moved|%'{$fids}
");
$num_threads = $db->fetch_field($query2, "thread_count");





		$db->update_query("users", array("threadnum" => (int)$num_threads), "uid='{$user['uid']}'");
}


		$db->update_query("users", array("threadnum" => (int)$num_threads), "uid='{$user['uid']}'");
}


Zeile 215Zeile 200
 * Recount reputation values
*/
function acp_recount_reputation()

 * Recount reputation values
*/
function acp_recount_reputation()

{
global $db, $mybb, $lang;

$query = $db->simple_select("users", "COUNT(uid) as num_users");
$num_users = $db->fetch_field($query, 'num_users');


{
global $db, $mybb, $lang;

$query = $db->simple_select("users", "COUNT(uid) as num_users");
$num_users = $db->fetch_field($query, 'num_users');


	$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('reputation', MyBB::INPUT_INT);

	$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('reputation', MyBB::INPUT_INT);

	if($per_page <= 0)
{
$per_page = 500;
}
$start = ($page-1) * $per_page;
$end = $start + $per_page;

$query = $db->simple_select("users", "uid", '', array('order_by' => 'uid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($user = $db->fetch_array($query))


$start = ($page-1) * $per_page;
$end = $start + $per_page;

$query = $db->simple_select("users", "uid", '', array('order_by' => 'uid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($user = $db->fetch_array($query))




	{
$query2 = $db->query("
SELECT SUM(reputation) as total_rep
FROM ".TABLE_PREFIX."reputation

	{
$query2 = $db->query("
SELECT SUM(reputation) as total_rep
FROM ".TABLE_PREFIX."reputation

			WHERE `uid`='{$user['uid']}'

			WHERE uid='{$user['uid']}'

		");
$total_rep = $db->fetch_field($query2, "total_rep");

		");
$total_rep = $db->fetch_field($query2, "total_rep");





		$db->update_query("users", array("reputation" => (int)$total_rep), "uid='{$user['uid']}'");
}


		$db->update_query("users", array("reputation" => (int)$total_rep), "uid='{$user['uid']}'");
}


Zeile 258Zeile 240

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('warning', MyBB::INPUT_INT);


$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('warning', MyBB::INPUT_INT);

	if($per_page <= 0)
{
$per_page = 500;
}






	$start = ($page-1) * $per_page;
$end = $start + $per_page;

	$start = ($page-1) * $per_page;
$end = $start + $per_page;





	$query = $db->simple_select("users", "uid", '', array('order_by' => 'uid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($user = $db->fetch_array($query))
{

	$query = $db->simple_select("users", "uid", '', array('order_by' => 'uid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($user = $db->fetch_array($query))
{

Zeile 285Zeile 264
 * Recount private messages (total and unread) for users
*/
function acp_recount_private_messages()

 * Recount private messages (total and unread) for users
*/
function acp_recount_private_messages()

{
global $db, $mybb, $lang;

{
global $db, $mybb, $lang;


$query = $db->simple_select("users", "COUNT(uid) as num_users");
$num_users = $db->fetch_field($query, 'num_users');

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('privatemessages', MyBB::INPUT_INT);


$query = $db->simple_select("users", "COUNT(uid) as num_users");
$num_users = $db->fetch_field($query, 'num_users');

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('privatemessages', MyBB::INPUT_INT);

	if($per_page <= 0)
{
$per_page = 500;
}
$start = ($page-1) * $per_page;
$end = $start + $per_page;

require_once MYBB_ROOT."inc/functions_user.php";



$start = ($page-1) * $per_page;
$end = $start + $per_page;

require_once MYBB_ROOT."inc/functions_user.php";





	$query = $db->simple_select("users", "uid", '', array('order_by' => 'uid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($user = $db->fetch_array($query))
{

	$query = $db->simple_select("users", "uid", '', array('order_by' => 'uid', 'order_dir' => 'asc', 'limit_start' => $start, 'limit' => $per_page));
while($user = $db->fetch_array($query))
{

Zeile 309Zeile 285
	}

check_proceed($num_users, $end, ++$page, $per_page, "privatemessages", "do_recountprivatemessages", $lang->success_rebuilt_private_messages);

	}

check_proceed($num_users, $end, ++$page, $per_page, "privatemessages", "do_recountprivatemessages", $lang->success_rebuilt_private_messages);

}

}


/**
* Recount referrals for users
*/
function acp_recount_referrals()


/**
* Recount referrals for users
*/
function acp_recount_referrals()

{
global $db, $mybb, $lang;

{
global $db, $mybb, $lang;


$query = $db->simple_select("users", "COUNT(uid) as num_users");
$num_users = $db->fetch_field($query, 'num_users');


$query = $db->simple_select("users", "COUNT(uid) as num_users");
$num_users = $db->fetch_field($query, 'num_users');

Zeile 338Zeile 314

$db->update_query("users", array("referrals" => (int)$num_referrers), "uid='{$user['uid']}'");
}


$db->update_query("users", array("referrals" => (int)$num_referrers), "uid='{$user['uid']}'");
}





	check_proceed($num_users, $end, ++$page, $per_page, "referral", "do_recountreferral", $lang->success_rebuilt_referral);
}

	check_proceed($num_users, $end, ++$page, $per_page, "referral", "do_recountreferral", $lang->success_rebuilt_referral);
}





/**
* Recount thread ratings
*/
function acp_recount_thread_ratings()

/**
* Recount thread ratings
*/
function acp_recount_thread_ratings()

{
global $db, $mybb, $lang;


{
global $db, $mybb, $lang;


	$query = $db->simple_select("threads", "COUNT(*) as num_threads");
$num_threads = $db->fetch_field($query, 'num_threads');

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('threadrating', MyBB::INPUT_INT);

	$query = $db->simple_select("threads", "COUNT(*) as num_threads");
$num_threads = $db->fetch_field($query, 'num_threads');

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('threadrating', MyBB::INPUT_INT);

	if($per_page <= 0)
{
$per_page = 500;
}






	$start = ($page-1) * $per_page;
$end = $start + $per_page;


	$start = ($page-1) * $per_page;
$end = $start + $per_page;


Zeile 370Zeile 343
			WHERE tid='{$thread['tid']}'
");
$recount = $db->fetch_array($query2);

			WHERE tid='{$thread['tid']}'
");
$recount = $db->fetch_array($query2);





		$db->update_query("threads", array("numratings" => (int)$recount['num_ratings'], "totalratings" => (int)$recount['total_rating']), "tid='{$thread['tid']}'");
}


		$db->update_query("threads", array("numratings" => (int)$recount['num_ratings'], "totalratings" => (int)$recount['total_rating']), "tid='{$thread['tid']}'");
}


Zeile 389Zeile 362

$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('attachmentthumbs', MyBB::INPUT_INT);


$page = $mybb->get_input('page', MyBB::INPUT_INT);
$per_page = $mybb->get_input('attachmentthumbs', MyBB::INPUT_INT);

	if($per_page <= 0)
{
$per_page = 20;
}






	$start = ($page-1) * $per_page;
$end = $start + $per_page;


	$start = ($page-1) * $per_page;
$end = $start + $per_page;


Zeile 450Zeile 420
		echo $form->generate_hidden_field("page", $next_page);
echo $form->generate_hidden_field($name, $per_page);
echo $form->generate_hidden_field($name2, $lang->go);

		echo $form->generate_hidden_field("page", $next_page);
echo $form->generate_hidden_field($name, $per_page);
echo $form->generate_hidden_field($name2, $lang->go);

		echo "<div class=\"confirm_action\">\n";
echo "<p>{$lang->confirm_proceed_rebuild}</p>\n";
echo "<br />\n";
echo "<script type=\"text/javascript\">$(function() { var button = $(\"#proceed_button\"); if(button.length > 0) { button.val(\"{$lang->automatically_redirecting}\"); button.attr(\"disabled\", true); button.css(\"color\", \"#aaa\"); button.css(\"borderColor\", \"#aaa\"); document.forms[0].submit(); }})</script>";
echo "<p class=\"buttons\">\n";
echo $form->generate_submit_button($lang->proceed, array('class' => 'button_yes', 'id' => 'proceed_button'));
echo "</p>\n";
echo "</div>\n";

		output_auto_redirect($form, $lang->confirm_proceed_rebuild);









$form->end();



$form->end();


Zeile 477Zeile 440
		if(!isset($mybb->input['page']) || $mybb->get_input('page', MyBB::INPUT_INT) < 1)
{
$mybb->input['page'] = 1;

		if(!isset($mybb->input['page']) || $mybb->get_input('page', MyBB::INPUT_INT) < 1)
{
$mybb->input['page'] = 1;

		}




		}

$plugins->run_hooks("admin_tools_do_recount_rebuild");


		if(isset($mybb->input['do_rebuildforumcounters']))
{
$plugins->run_hooks("admin_tools_recount_rebuild_forum_counters");

		if(isset($mybb->input['do_rebuildforumcounters']))
{
$plugins->run_hooks("admin_tools_recount_rebuild_forum_counters");


if($mybb->input['page'] == 1)
{


if($mybb->input['page'] == 1)
{

				// Log admin action
log_admin_action("forum");

				// Log admin action
log_admin_action("forum");

			}
if(!$mybb->get_input('forumcounters', MyBB::INPUT_INT))
{
$mybb->input['forumcounters'] = 50;
}



			}

$per_page = $mybb->get_input('forumcounters', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)
{
$mybb->input['forumcounters'] = 50;
}


acp_rebuild_forum_counters();
}
elseif(isset($mybb->input['do_rebuildthreadcounters']))


acp_rebuild_forum_counters();
}
elseif(isset($mybb->input['do_rebuildthreadcounters']))

		{
$plugins->run_hooks("admin_tools_recount_rebuild_thread_counters");


		{
$plugins->run_hooks("admin_tools_recount_rebuild_thread_counters");


			if($mybb->input['page'] == 1)
{
// Log admin action
log_admin_action("thread");

			if($mybb->input['page'] == 1)
{
// Log admin action
log_admin_action("thread");

			}
if(!$mybb->get_input('threadcounters', MyBB::INPUT_INT))
{
$mybb->input['threadcounters'] = 500;



			}

$per_page = $mybb->get_input('threadcounters', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)
{
$mybb->input['threadcounters'] = 500;

			}

acp_rebuild_thread_counters();
}
elseif(isset($mybb->input['do_recountuserposts']))

			}

acp_rebuild_thread_counters();
}
elseif(isset($mybb->input['do_recountuserposts']))

		{
$plugins->run_hooks("admin_tools_recount_rebuild_user_posts");


		{
$plugins->run_hooks("admin_tools_recount_rebuild_user_posts");


			if($mybb->input['page'] == 1)
{
// Log admin action
log_admin_action("userposts");
}

			if($mybb->input['page'] == 1)
{
// Log admin action
log_admin_action("userposts");
}

			if(!$mybb->get_input('userposts', MyBB::INPUT_INT))




$per_page = $mybb->get_input('userposts', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)

			{
$mybb->input['userposts'] = 500;
}

			{
$mybb->input['userposts'] = 500;
}

Zeile 536Zeile 507
				// Log admin action
log_admin_action("userthreads");
}

				// Log admin action
log_admin_action("userthreads");
}

			if(!$mybb->get_input('userthreads', MyBB::INPUT_INT))




$per_page = $mybb->get_input('userthreads', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)

			{
$mybb->input['userthreads'] = 500;
}

			{
$mybb->input['userthreads'] = 500;
}

Zeile 553Zeile 526
				log_admin_action("attachmentthumbs");
}


				log_admin_action("attachmentthumbs");
}


			if(!$mybb->get_input('attachmentthumbs', MyBB::INPUT_INT))


			$per_page = $mybb->get_input('attachmentthumbs', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)

			{
$mybb->input['attachmentthumbs'] = 500;
}

			{
$mybb->input['attachmentthumbs'] = 500;
}

Zeile 570Zeile 544
				log_admin_action("reputation");
}


				log_admin_action("reputation");
}


			if(!$mybb->get_input('reputation', MyBB::INPUT_INT))


			$per_page = $mybb->get_input('reputation', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)

			{
$mybb->input['reputation'] = 500;
}

			{
$mybb->input['reputation'] = 500;
}

Zeile 587Zeile 562
				log_admin_action("warning");
}


				log_admin_action("warning");
}


			if(!$mybb->get_input('warning', MyBB::INPUT_INT))


			$per_page = $mybb->get_input('warning', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)

			{
$mybb->input['warning'] = 500;
}

			{
$mybb->input['warning'] = 500;
}

Zeile 604Zeile 580
				log_admin_action("privatemessages");
}


				log_admin_action("privatemessages");
}


			if(!$mybb->get_input('privatemessages', MyBB::INPUT_INT))


			$per_page = $mybb->get_input('privatemessages', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)

			{
$mybb->input['privatemessages'] = 500;
}

			{
$mybb->input['privatemessages'] = 500;
}

Zeile 621Zeile 598
				log_admin_action("referral");
}


				log_admin_action("referral");
}


			if(!$mybb->get_input('referral', MyBB::INPUT_INT))


			$per_page = $mybb->get_input('referral', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)

			{
$mybb->input['referral'] = 500;
}

			{
$mybb->input['referral'] = 500;
}

Zeile 638Zeile 616
				log_admin_action("threadrating");
}


				log_admin_action("threadrating");
}


			if(!$mybb->get_input('threadrating', MyBB::INPUT_INT))


			$per_page = $mybb->get_input('threadrating', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)

			{
$mybb->input['threadrating'] = 500;
}

			{
$mybb->input['threadrating'] = 500;
}

Zeile 655Zeile 634
				log_admin_action("poll");
}


				log_admin_action("poll");
}


			if(!$mybb->get_input('pollcounters', MyBB::INPUT_INT))


			$per_page = $mybb->get_input('pollcounters', MyBB::INPUT_INT);
if(!$per_page || $per_page <= 0)

			{
$mybb->input['pollcounters'] = 500;
}

			{
$mybb->input['pollcounters'] = 500;
}