Resource icon

Post Content Find / Replace 1.0.0

No permission to download
does your post look like this with the url linked or notView attachment 22965
Lemme know and I will give it a try.
No the url is not linked, this is what it produces. (Just like youtube videos)

vimeo.webp


Eidt: Basically it needs to go from this

Code:
[video=vimeo;20759609]http://vimeo.com/20759609[/video]

To this:

Code:
[media=vimeo]20759609[/media]


----------------------------------
Testing Vimeo embed code

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
 
Have you already setup a xenforo install and imported your db and are using this addon to replace post content...or are you trying to replace eveything ahead of time...I am a little confused because I see the screenshot and I see that it is not xenforo.
 
Have you already setup a xenforo install and imported your db and are using this addon to replace post content...or are you trying to replace eveything ahead of time...I am a little confused because I see the screenshot and I see that it is not xenforo.
I have a test install with my vB4 database imported, it's not currently live. However I'd prefer having the expressions ready before I DO upgrade/migrate the live site.

How about we start over. :D

I'm looking to convert the following:
Code:
[video=vimeo;20759609]http://vimeo.com/20759609[/video]
To
Code:
[media=vimeo]20759609[/media]



And



Code:
[video=youtube;aNsucu92jwk]http://www.youtube.com/watch?v=aNsucu92jwk[/video]

To

Code:
[media=youtube]aNsucu92jwk[/media]
 
#\[video\=vimeo\;[0-9]+\]http://vimeo.com/#si matches [video=vimeo;20759609]http://vimeo.com/

#\[/video\]#si matches [/video]
123.webp1234.webp

As long as that works out for you on your testbed, I will post up the youtube as well.
 
#\[video\=vimeo\;[0-9]+\]http://vimeo.com/#si matches [video=vimeo;20759609]http://vimeo.com/

#\[/video\]#si matches [/video]

As long as that works out for you on your testbed, I will post up the youtube as well.
No that's not right, the Regular Expression should grab just the 20759609 and the Replacement String should be something like this:
Code:
[media=vimeo]\2[/media]
You can check it here. http://www.spaweditor.com/scripts/regex/index.php
 
Code:
#\[video\=vimeo\;[0-9]+\]http://vimeo.com/#si
matches
Code:
Array
(
    [0] => Array
        (
            [0] => [video=vimeo;20759609]http://vimeo.com/
        )
 
)

It catches just fine....
If you have
[video=vimeo;20759609]http://vimeo.com/20759609[/video]

the id is there twice, I am matching from the [ to the / after .com replace that with [media=vimeo]

ill use that page you posted to show you...I switched the match function to a replace there so you can see the replacement..
regex1234.webp
On the other post where I showed an image of the post replacement tool...I didn't put the replacement string in...that line would be the line from this image named 'Enter text to replace matches with here: (backreferences are ok)'

I know it worked because I tried it :)
 
Code:
#\[video\=vimeo\;[0-9]+\]http://vimeo.com/#si
matches
Code:
Array
(
    [0] => Array
        (
            [0] => [video=vimeo;20759609]http://vimeo.com/
        )
 
)

It catches just fine....
If you have
[video=vimeo;20759609]http://vimeo.com/20759609[/video]

the id is there twice, I am matching from the [ to the / after .com replace that with [media=vimeo]

ill use that page you posted to show you...I switched the match function to a replace there so you can see the replacement..
View attachment 23044
On the other post where I showed an image of the post replacement tool...I didn't put the replacement string in...that line would be the line from this image named 'Enter text to replace matches with here: (backreferences are ok)'

I know it worked because I tried it :)
I see what you're doing now. (y) I ran it on my test build and it works (reference that link I PM'd), now I just need the youtube one.

FYI still have to replace the [/video] with [/media]
 
btw be careful with that regex tester...it randomly removes 'e' chars from strings when you click to process.
 
#\[video=youtube\;[a-z0-9-_]+\]http\://www\.youtube\.com/watch\?v=#si

replace with:

[media=youtube]

The closing tag should be changed already per the post above.
I get the following error after checking save and clicking proceed
"Please enter a message with no more than 5 pieces of media."
 
You have a post with more than 5 media embeds in it.

Increase the value in Options.

Search for: Maximum Media Embeds per Message
 
I have downloaded and installed this add on and I did a run of it yesterday to which it managed to find 2 and fix fine however I am unable to get it to fix the rest that I still have on the forums.

Currently I still have the following on my forums which haven't fixed

Code:
[ame]http://www.youtube.com/watch?v=76RbWuFll0Y&ob=av2e[/ame]

I have tried using the following to find and replace these posts but it does not seem to work

Code:
Quick Find: [ame
Regular Expression: #\[ame]("|'|)http:.+youtube.+v=(\w+)\1\].+\[/ame]#siU
Replacement String: [media=youtube]\2[/media]

any help is greatly appreciated.
 
I have downloaded and installed this add on and I did a run of it yesterday to which it managed to find 2 and fix fine however I am unable to get it to fix the rest that I still have on the forums.

Currently I still have the following on my forums which haven't fixed

Code:
[ame]http://www.youtube.com/watch?v=76RbWuFll0Y&ob=av2e[/ame]

I have tried using the following to find and replace these posts but it does not seem to work

Code:
Quick Find: [ame
Regular Expression: #\[ame]("|'|)http:.+youtube.+v=(\w+)\1\].+\[/ame]#siU
Replacement String: [media=youtube]\2[/media]

any help is greatly appreciated.
Try these in this order

Quick Find: [ame
Regular Expression: #\[ame].+watch\?v=#siu
Replacement String: [media=youtube]


Quick Find: ame]
Regular Expression: #(&([a-z0-9]+)(.*))*\[/ame]#siu
Replacement String:
 
Back
Top Bottom