I did not create this method. Was searching for a way to show different ads to UK vs rest of EU vs ES, etc. Found it here:http://www.pokeraffiliatelistings.c...26347-geotarget-tool-non-wordpress-sites.html
Just copying it over to here, adapted with some Xenforo-specific details, so I don't...
You can run these two queries to approve all moderated posts:
DELETE
FROM xf_moderation_queue
WHERE content_type = 'post';
UPDATE xf_post
SET message_state = 'visible'
WHERE message_state = 'moderated';
And here are the queries to approve all moderated threads:
DELETE
FROM xf_moderation_queue...
You can run these queries to soft delete all moderated posts. You need to change the red pieces to attribute these deletions to a user_id and username, as well as give the reason. These things are recorded in the deletion log:
INSERT INTO xf_deletion_log (content_type, content_id, delete_date...
This will recalculate and update the post counts for all users at once. This is a large query that may take a while to finish.
UPDATE xf_user AS user
SET message_count = (
SELECT COUNT(*)
FROM xf_post AS post
LEFT JOIN xf_thread AS thread ON (thread.thread_id = post.thread_id)...