Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Ok but you should know that if you do this this way, any links in posts that are not to your own forum but follow that same scheme will be broken.

Realistically to do this right I would need a full link including your forum's domain.

If you are absolutely positive that no other links in your forum go to a vb based forum outside of your own than I can give you an expression that will work as you asked, otherwise I will need to capture more than just the part you posted.
 
should i use this Add-on?
Redirection Scripts for vBulletin 3.x 6.0
http://xenforo.com/community/resources/redirection-scripts-for-vbulletin-3-x.264/
If that is what you need to do...but it will not change the data in the posts...they will still display incorrect links to your forum even if they redirect once clicked on.

I have never had a vb forum to import so I really can't tell you based on that fact...your best bet would be to ask @Mike about that but if it were me and I did import a forum I would assume the redirection script would be used to redirect inbound traffic to your site to the appropriate places and I would still replace the text in posts that referrance my own forum so that everything looked clean and right.
 
After importing from smf, all my old quotes look like this:

[quote author=liloleman link=topic=45883.msg155275#msg159275 date=1359910405]

Can someone tell me what replacement string would work for replacing this with [ quote="username" ]

TIA
 
After importing from smf, all my old quotes look like this:

[quote author=liloleman link=topic=45883.msg155275#msg159275 date=1359910405]

Can someone tell me what replacement string would work for replacing this with [ quote="username" ]

TIA
Going to bed this moment, but have a question, after importing from smf did the smf message # being msg155275 import as the same message in xenforo. If not that's fine, but if it did I can add the message in the expression.
 
Last edited:
Going to be red this moment, but have a question, after importing from smf did the smf message # being msg155275 import as the same message in xenforo. If not that's fine, but if it did I can add the message in the expression.

No, it did not import as the same message. Thank you!
 
Ok but you should know that if you do this this way, any links in posts that are not to your own forum but follow that same scheme will be broken.

Realistically to do this right I would need a full link including your forum's domain.

If you are absolutely positive that no other links in your forum go to a vb based forum outside of your own than I can give you an expression that will work as you asked, otherwise I will need to capture more than just the part you posted.
that is Query helped me:
Code:
UPDATE xf_post SET message = replace(message,"www.mysite.com/forum/showthread.php?t=","www.mysite.com/forum/index.php?threads/");
Thank you
alkahf
 
Last edited:
No, it did not import as the same message. Thank you!
Just woke up here, sorry had a long day yesterday.


Wait a sec don't use it yet...just realized it wont capture nested quotes...let me get some coffee and then i will edit this post and tag you

@imno007 Ok so I blame not being fully awake but I made the expression more complex than it needed to be...this will work

*edited
Code:
Quick Find:            [quote author
Regular expression:    #\[quote\sauthor=([a-z0-9\s]+)\slink[^\]]+]#siu
Replacement String:    [quote="\1"]

Let me know how this works out for you.
 
Last edited:
I'm working on a conversion from ipb 1.3 -> Xenforo (passing through phpBB in the middle). However, a lot of my bbcode has turned into html through the process. So, I'm seeing things like this all throughout the posts:

<div align="center">Centered Text</div>

<div align="justify">Justifed text</div>

<span style='color:Mediumpurple'>Purple Text</span>

<span style='color:Mediumpurple'><span style='font-size:21pt;line-height:100%'><span style='font-family:Optima'>Header</span></span></span>

I'd like to turn however much I can back into bbcode, though I know nothing about expressions. Would somebody be able to give me a hand?
 
hello
i think my Query in this post #267 will help you to replace any thing in post message.
For example put this to replace <div align="center"> with [CENTER ] by this Query throw phpMyAdmin > SQL:
Code:
UPDATE xf_post SET message = replace(message,"<div align="center">","[center]");
 
Hm, would there be a way to also get the appropriate closing tags? i.e., the closing alignment tags are just </div> right now. But they could be /left, /right, or /center if they get converted properly.

Also, is there a way to handle the html -> bbcode with variables in it? Like the font sizes and colors? There's no set list of colors that are used on my old forum, so those could be anything.
 
I'm working on a conversion from ipb 1.3 -> Xenforo (passing through phpBB in the middle). However, a lot of my bbcode has turned into html through the process. So, I'm seeing things like this all throughout the posts:

I'd like to turn however much I can back into bbcode, though I know nothing about expressions. Would somebody be able to give me a hand?

I cannot see all the different possibilities that should be caught but try testing this and let me know what you get , I can't test everything 100% because I cannot guess at all the possibilities that I would come across having had a copy of such a conversion myself, as of now I am working with just a few examples provided that do not reflect every possibility.

If you do feel like testing this on a testbed...
be sure to have a backup and be working from that backup and ABSOLUTELY NOT be doing this on a live site


This will also replace any tags inside code blocks that match, if you can live with that these should work for you.
Quick Find: <span
Regular expression: #\<span\sstyle\=\'font\-family\:([a-z0-9-]+)\'\>#siu
Replacement String: [FONT=\1]

Quick Find: <span
Regular expression: #\<span\sstyle\=\'color\:([a-z0-9-\#]+)\'\>#siu
Replacement String: [COLOR=\1]



_____________________
Use this last to clean up empty closing spans after you have replaced all spans

Quick Find: </span
Regular expression: #\<\/span\>#siu
Replacement String:
 
Last edited:
Thanks! But when I tried that, I got this error.

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 26506 bytes) in \library\Zend\Db\Statement\Mysqli.php on line 276

Probably because I do have over 76000 posts this would be going through.
 
Need help converting these BBCodes to XF

[BBvideo 600,300:12rwum1k]https://www.youtube.com/watch?v=AkNQom3EPTc[/BBvideo]
to
[media=youtube]

viewtopic.php?f=8&t=2377
to
threads/2377


Remove these BBCodes from content

[glow=Red]
[highlight=#ffffff]
 
Last edited:
to replace: [BBvideo 600,300:12rwum1k].+[/BBvideo] with xf's media tag for youtube

Quick Find: [BBvideo
Regular expression: #\[bbvideo\s[a-z0-9,:]+\][^\=]+\=([^\[]+)\[\/bbvideo]#siu
Replacement String: [media=youtube]\1[/media]

----------------------------------------------------------

To make your thread links relevant (you need to customize this to only effect links to your site...please contact me privately for that)

Quick Find: viewtopic.php
Regular expression: #viewtopic\.php\?f\=[0-9]+\&t\=([0-9]+)#siu
Replacement String: threads/\1

----------------------------------------------------------

To remove the opening glow tag
Quick Find: [glow
Regular expression: #\[glow\=([a-z0-9\#]+)\]#siu
Replacement String:

----------------------------------------------------------

To remove the opening highlight tag
Quick Find: [highlight=
Regular expression: #\[highlight\=([a-z0-9\\\#]+)\]#siu
Replacement String:

----------------------------------------------------------

To remove the closing glow tag
Quick Find: [/glow
Regular expression: #\[\/glow\]#siu
Replacement String:

----------------------------------------------------------

To remove the closing tag
Quick Find: [/highlight
Regular expression: #\[\/highlight\]#siu
Replacement String:
 
Last edited:
All the Regex worked brilliant. Thank you so much

Issue with URL Regex.URL seems to have converted to

threads/2384#p8101

but in XF its

threads/2384/#post-8101


Can we also convert it for attachments

Phpbb file attachment URL is

download/file.php?id=8

to XF

attachments/name-fileextension.8/
 
For phpbb users some simple URL parameters.


Quick Find : &p=
Regex : #\&p\=([0-9]+)#siu
Replacement :

Quick Find : &start=
Regex : #\&start\=([0-9]+)#siu
Replacement :

Quick Find : [twitbox]
Regex : #\[twitbox].+\[\/twitbox]#siu
Replacement :

Quick Find : download/file.php?id=
Regex : #download\/file\.php\?id\=([0-9]+)#siu
Replacement : attachments/\1

Will update this thread with more info
 
Last edited:
All the Regex worked brilliant. Thank you so much

Issue with URL Regex.URL seems to have converted to

threads/2384#p8101

but in XF its

threads/2384/#post-8101


Can we also convert it for attachments

Phpbb file attachment URL is

download/file.php?id=8

to XF

attachments/name-fileextension.8/
can you give me full links please...it is hard to guess what the rest of the link looks like for forum software I don't use and I really need full links to do this. You can convo me those if you like...

Also are you looking for a fix to the regex for the urls , or are you just testing now and looking to have the expression fixed so that it catches it on the first shot?
 
Top Bottom