SQL solution to approve all posts?

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
infinitiv
Registered User
Posts: 166
Joined: Sat Nov 15, 2014 3:47 pm
Location: PL
Name: Ficjusz

SQL solution to approve all posts?

Post by infinitiv » Mon Jul 10, 2017 9:42 pm

Hi, I messed up my database. :D
I tried to approve 7k+ posts after converting from phpBB 2. Somehow they weren’t approved. Doing it by hand would take terrible amount of time, so I tried to edit those posts properties directly in the database.

In forum_posts_approved and forum_topics_approved I set exact number of posts and topics in each forum. In forum_topics_unapproved and forum_posts_unapproved I just set 0.

I also altered every problematic post in phpbb_posts, changing „post_visibility” from „3” to „1”. The result is that I can see all the posts (I’m an administrator) without need for approving them, but users don’t see them, like the posts weren’t approved at all.

What else do I need to change in my database to make all posts approved?
Last edited by infinitiv on Mon Jul 10, 2017 11:00 pm, edited 1 time in total.

infinitiv
Registered User
Posts: 166
Joined: Sat Nov 15, 2014 3:47 pm
Location: PL
Name: Ficjusz

Re: SQL solution to approve all posts?

Post by infinitiv » Mon Jul 10, 2017 9:59 pm

The thing is… What does post approval change in the database? I tried to catch that but besides changing post_visibility there’s nothing more AFAIK…

User avatar
AmigoJack
Registered User
Posts: 5599
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: SQL solution to approve all posts?

Post by AmigoJack » Tue Jul 11, 2017 7:11 am

Are we really talking about posts? Or can users not even see the topics (because there's also phpbb_topics.topic_visibility)? Oh and all post author's post+topic counts are now wrong as well.
The worst thing about censorship is ███████████
Affin wrote:
Tue Nov 20, 2018 9:51 am
The problem is probably not my English but you do not want to understand correctly.
...
We will not come anybody anyway, nevertheless, it's best to shit this.

infinitiv
Registered User
Posts: 166
Joined: Sat Nov 15, 2014 3:47 pm
Location: PL
Name: Ficjusz

Re: SQL solution to approve all posts?

Post by infinitiv » Tue Jul 11, 2017 8:38 am

AmigoJack wrote:
Tue Jul 11, 2017 7:11 am
Are we really talking about posts? Or can users not even see the topics (because there's also phpbb_topics.topic_visibility)? Oh and all post author's post+topic counts are now wrong as well.
Only posts aren’t visible, topics are perfectly fine. For example – there’s a thread with 8 pages, users can see only first page. Moderators can see – all of them. None of them needs approval. I think that the post counts are fine, since I’ve resynchronised them.

infinitiv
Registered User
Posts: 166
Joined: Sat Nov 15, 2014 3:47 pm
Location: PL
Name: Ficjusz

Re: SQL solution to approve all posts?

Post by infinitiv » Tue Jul 11, 2017 10:24 am

Funny thing is that posts are visible for users in the topic preview during making a new post.

infinitiv
Registered User
Posts: 166
Joined: Sat Nov 15, 2014 3:47 pm
Location: PL
Name: Ficjusz

Re: SQL solution to approve all posts?

Post by infinitiv » Tue Jul 11, 2017 10:41 am

I manage to fix the issue by editing phpbb_topics and switching values in topic_posts_approved and topic_posts_unapproved where the first was 0 and the last was greater than 1. So that was what I missed.

Post Reply

Return to “[3.2.x] Support Forum”