Reparse posts with extension or easy php addon

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Get Involved
Xymox2017
Registered User
Posts: 40
Joined: Tue Mar 07, 2017 3:06 pm

Reparse posts with extension or easy php addon

Post by Xymox2017 »

I have converted a lot of usenet and newsgroups posts into a phpbb forum.
This is done using straight inserts into the phpbb database and works fine.

As those posts are not entered using the phpbb web interface, the reparsing was not done.
Most of the posts in phpbb database are not conform the XML standard.
When I edit such a post and save without touching the post text itself, the reparser is used and then the post has the correct XML format.

So I need to reparse those posts to get, for instance, all the BBCodes correctly displayed.

Reading the documentation I can use CLI to reparse. But this seems a bit spartanic.
I would like to have more control which subforums to reparse and also do some small tests without reparsing everything.
(I'm not familiar with CLI and am not comfortable to try it out)

I wonder if there is some kind of extension or php addon to install which does reparsing and let me decide what to reparse.

Also described is that phpbb does this automatically with a cron job, but I think this is not enabled by default?

The posts are there for years now and I do not see any new automatic reparse executed.

Best would be a php file I could place inside my forum and execute it to reparse instead of CLI.


Any help or tips are appreciated.
Last edited by thecoalman on Mon Sep 02, 2024 4:01 pm, edited 1 time in total.
Reason: Moved to extension requests
User avatar
nou nou
Registered User
Posts: 706
Joined: Sat Oct 29, 2016 8:08 pm

Re: Reparse posts with extension or easy php addon

Post by nou nou »

I needed exactly that the other day, and this is working well for me: https://github.com/s9e/phpbb-ext-reparser
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 6410
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Reparse posts with extension or easy php addon

Post by thecoalman »

Using the reparser is effectively the same thing as opening and then submitting the post except it does it for every post. It's also reparses some other columns. Private messages, signatures and anywhere else bbcode is used.

If you want to run some tests do it locally using XAMPP, in the XAMPP control panel is button for shell which will open command prompt and you can run some nix commands like the one needed for reparser. Just copy the entire DB before running test and then you can repeat test as needed. I don't recall how long it runs but it's not a ridiculous amount of time. Of course your mileage will vary depending on the amount of posts.

I don't know exactly what triggers cron but when you upgrade from version with old formatting to new formatting it's automatically set to resparse everything that needs to be reparsed. It's just a slower process and it takes it in chunks. It certainly would be possible to set it to reparse posts.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison

Return to “Extension Requests”