Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add hooks where post counters are updated.
#1
I'm coding a plugin that needs to recount posts, but apparently not all places where counting occurs have hooks. The following code should add one hook. File /admin/modules/user/users.php.
while($user = $db->fetch_array($query))
{
	// Protect Super Admins
	if(is_super_admin($user['uid']) && !is_super_admin($mybb->user['uid']))
	{
		continue;
	}

	$return_array = delete_user_posts($user['uid'], $date); // Delete user posts, and grab a list of threads to delete
	if($return_array && is_array($return_array))
	{
		$prune_array = array_merge_recursive($prune_array, $return_array);
	}
}
Reply


Messages In This Thread
Add hooks where post counters are updated. - by Omar G. - 2019-01-27, 04:20 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)