Topic: Global regex search/replace

The BBCode parser in Invision and Pun are very different.  Invision's parser lets you jam all sorts of stuff up in the quote box, including the username and the timestamp, while Pun's doesn't expect all that.

I recently converted my forums over to Pun, and am now stuck with threads that fall out of their <div> after the first malformed quote tag: http://bonzoesc.net/punbb-new/viewtopic … 094#p18094

Is there an easy way I can globally change every quote tag to lose the timestamp, or do I get to iterate through every post in the database and swap them out?

Re: Global regex search/replace

The easiest way would be to write a small script that loops through all the posts and runs a regular expression, removing the timestamp. An alterantive in your case would be to change the bbcode parser so that it deals with the timestamp. Could you post some examples of how it looks (in code blocks)? Maybe I can be of assistance.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Global regex search/replace

PunBB compatible:

[quote=BonzoESC]After a recent bout of spamming by somebody who will be unnamed, I've modified the rules (available at the "Some Rules" link right under the random banner) to reflect the new addition to the rules.

Repeated rampancy of both AIs and humans will be punished by having us read their posts before they become visible.  We'll also pass notes and whisper.
[right][snapback]6681[/snapback][/right][/quote]
[url=http://www.bonzoesc.net/lorforums/index.php?act=boardrules]http://www.bonzoesc.net/lorforums/index.php?act=boardrules[/url]

THE ONLY RULE IS, THERE ARE NO RULES  :chainsaw:

PunBB incompatible:

[quote=Chris!,Dec 31 2004, 12:56 PM][url=http://www.bonzoesc.net/lorforums/index.php?act=boardrules]http://www.bonzoesc.net/lorforums/index.php?act=boardrules[/url]

THE ONLY RULE IS, THERE ARE NO RULES  :chainsaw:
[right][snapback]18094[/snapback][/right][/quote]
finally, ten points for anarchy that works

It looks like I'll be scritping tomorrow, to also lose the snapbacks and right-aligned tags.

BTW, you're scary fast at replying smile

Re: Global regex search/replace

Actually, before we try anything else, try applying this fix from the upcoming PunBB 1.2.1: http://punbb.org/forums/viewtopic.php?pid=30055#p30055

"Programming is like sex: one mistake and you have to support it for the rest of your life."

5

Re: Global regex search/replace

I just entered the invalid quote directly into the database. It outputs normally in my dev version which includes the fix.

Re: Global regex search/replace

That did it!  Thanks for the help.

Re: Global regex search/replace

No problem. I thought the migration tool took care of the timestamp, but I guess it doesn't.

"Programming is like sex: one mistake and you have to support it for the rest of your life."