Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Hey there try this, as always on a test site if you can first...I don't have full imports to test this against.

Quick Find:
Code:
[mention


Regular expression:
Code:
#\[mention=([0-9]+)]([^\[]+)\[/mention]#siu


Replacement String:
Code:
@[USER=\1]\2[/USER]
 
Hey there try this, as always on a test site if you can first...I don't have full imports to test this against.

Quick Find:
Code:
[mention


Regular expression:
Code:
#\[mention=([0-9]+)]([^\[]+)\[/mention]#siu


Replacement String:
Code:
@[USER=\1]\2[/USER]

I get this error :/

Fatal error: Maximum execution time of 30 seconds exceeded in /home/xx/public_html/library/Zend/Db/Adapter/Mysqli.php on line 421
 
How do i convert the facebook media?

PHP:
[video=facebook;158136321047560]https://www.facebook.com/photo.php?v=158136321047560[/video]

[video=facebook;1415000942047651]https://www.facebook.com/photo.php?v=1415000942047651&set=vb.418993998144428&type=2&theater[/video]
 
How do i convert the facebook media?

PHP:
[video=facebook;158136321047560]https://www.facebook.com/photo.php?v=158136321047560[/video]

[video=facebook;1415000942047651]https://www.facebook.com/photo.php?v=1415000942047651&set=vb.418993998144428&type=2&theater[/video]

Quick Find:
Code:
[video=facebook


Regular expression:
Code:
#\[video=facebook;([0-9]+)][^\[]+\[/video]#siu


Replacement String:
Code:
[media=facebook]\1[/media]
 
I couldn't find the replacement I'm after.

Basically all my AME tags have been stripped out, and now all I got are plain youtube urls, that don't even show up as links. so something like this

Code:
http://www.youtube.com/watch?v=shPET-znvnk&WHATEVERHERE

What replacement should I do to get these to show up embedded in the posts?
 
Basically all my AME tags have been stripped out

I got plain youtube urls that don't even show up as links.

EXAMPLE:

Code:
http://www.youtube.com/watch?v=shPET-znvnk&WHATEVERHERE

What replacement should I do to get these to show up embedded in the posts?

Try this

Quick Find:
Code:
youtube


Regular expression:
Code:
#http://(?:www\.)?youtube\.com/watch\?v=([a-zA-Z0-9_-]{11})(?:[^\s]+)?#siu


Replacement String:
Code:
[media=youtube]\1[/media]
 
Last edited:
If I have a member named Arl Børch and want all mentions of that to be changed to Arl, what's the correct regexp?

I changed this member's username to the shorter one, but now I'd like to change all mentions of that old username to the new one, incl. tags, messages, quotes, replies, etc.

Possible? A bit of help is appreciated.
 
If I have a member named Arl Børch and want all mentions of that to be changed to Arl, what's the correct regexp?


I suppose this would work for you...



Quick Find:
Code:
Arl Børch


Regular expression:
Code:
#(Arl)\sBørch#siu


Replacement String:
Code:
\1
 
Regex flies a couple of solar systems height over my head and I need to get stuff ready to run when we migrate to Xenforo on Saturday.

Could someone please tell me how to replace
Code:
[playmp3]http://www.avpodcast.co.uk/podcast.mp3?p=
with
Code:
[playmp3]
please?

Also how do I change
Code:
[URL]http://www.youtube.com/watch?v=9upTLWRZTfw[/URL]
into the proper Xenforo youtube code please?
 
Last edited:
I think your first snippet may have been cut off.

For the youtube one, this would probably work:

Regex Match:
Code:
\[URL\]http:\/\/www\.youtube\.com/watch\?v=([a-zA-Z0-9]+)\[\/URL\]

Replacement:
Code:
[media=youtube]$1[/media]

Might be a little off. I'm not much of a regex person myself.
 
Could someone please tell me how to replace
Code:
[playmp3]http://www.avpodcast.co.uk/podcast.mp3?p=
with
Code:
[playmp3]
I need more info for that....but assuming that is exactly what you want to do and that your new bbcode uses [tag]ID[/tag] , then this would work.


Quick Find:
Code:
[playmp3


Regular expression:
Code:
#(\[playmp3])http://www.avpodcast.co.uk/podcast\.mp3\?p=#siu


Replacement String:
Code:
\1





Also how do I change
Code:
[URL]http://www.youtube.com/watch?v=9upTLWRZTfw[/URL]
into the proper Xenforo youtube code please?
Try this

Quick Find:
Code:
youtube


Regular expression: updated 10.23.13-11:31amEST
Code:
#(?:\[url])http(?:s)?://(?:www\.)?(?:[a-z0-9-]+\.)?youtu(?:be\.com/(?:[a-z]+(?:/api/videos/)?)|\.be)(?:\?v=|/)?([a-z0-9_-]{11})(?:[^\s]+)?(?:\[/url])#siu


Replacement String:
Code:
[media=youtube]\1[/media]
 
Last edited:
I need to modify the code

Code:
[COLOR=\"#3964C2\"]Album anzeigen[/COLOR][/URL]

to

Code:
[COLOR="#3964C2"]Album anzeigen[/COLOR][/URL]

(removed the two "\") but i cannot figure it out.
Somebody has a solution for me? Thanks :)
 
I need to modify the code

Code:
[COLOR=\"#3964C2\"]Album anzeigen[/COLOR][/URL]

to

Code:
[COLOR="#3964C2"]Album anzeigen[/COLOR][/URL]

(removed the two "\") but i cannot figure it out.
Somebody has a solution for me? Thanks :)

so does the url tag have anything to do with it or did you just put that in there for no reason?

Also, xf does not use [COLOR="#b0b0b0"]gsggfd[/COLOR] ... it uses [COLOR=#b0b0b0]gsggfd[/COLOR]
 
Last edited:
so does the url tag have anything to do with it or did you just put that in there for no reason?

Also, xf does not use [COLOR="#b0b0b0"]gsggfd[/COLOR] ... it uses [COLOR=#b0b0b0]gsggfd[/COLOR]

Sorry, i forgot to remove the [/URL] tag.
It's part of the Google Picasa RSS feed of my albums.

Code:
[COLOR=\"#3964C2\"]Album anzeigen[/COLOR]

It would be fine to remove the two " and \ after the COLOR= code ;)
 
Sorry, i forgot to remove the [/URL] tag.
It's part of the Google Picasa RSS feed of my albums.

Code:
[COLOR=\"#3964C2\"]Album anzeigen[/COLOR]

It would be fine to remove the two " and \ after the COLOR= code ;)

Quick Find:
Code:
[COLOR


Regular expression:
Code:
#(\[COLOR=)\\"(\#[a-z0-9]+)\\"(])#siu


Replacement String:
Code:
\1\2\3
 
Back
Top Bottom