Resource icon

Post Content Find / Replace 1.0.0

No permission to download
@Jake Bunce

The same error I had before:

Please enter a valid message.

Any suggestion?

That error means that the replacement is resulting in an empty message which is not allowed. Or it could also be non-empty, but containing only a BB code with an invalid param (from a bad replacement) such that the post is effectively empty due to the invalid BB code.

Try running the replacement again without saving changes. Then review the replacements to look for errors or empty messages.
 
Hello @Jake Bunce is there a easy way to do this?

I am asking you because I have thousands of posts with embedded youtube media. :(

I tried, I deleted some that I think had a problem (not sure) and I got the same error message.
 
@Parafal

You will see replacements like this:

[media=youtube]DV5ZyyCU0_g[/media]

My guess is that there are replacements with invalid video ids. This would be an example of an invalid id:

[media=youtube]DV5ZyyCU0_g&[/media]

I suppose we could tighten the regex to avoid this possibility:

Quick Find: [video

Regular Expression: #\[video=youtube;([a-zA-Z0-9_\-]+)\]([^\[]+)\[/video\]#siU

Replacement String: [media=youtube]\1[/media]
 
Hello @Jake Bunce

After 2 attempts following your last suggestion, I started to get some fatal errors:

ErrorException: Fatal Error: Maximum execution time of 30 seconds exceeded - library/XenForo/DataWriter/Discussion/Thread.php:142

and the second error message:
ErrorException: Fatal Error: Maximum execution time of 30 seconds exceeded - library/XenForo/BbCode/Formatter/Base.php:218

Screen Shot 2014-05-19 at 8.29.23 AM.webp

Any idea why this is happening?

Thank you very much for your help in this matter. ;)
 
Has anyone done this coming from a MyBB forum?

Syntax is slightly different:
Code:
[video=youtube]https://www.youtube.com/watch?v=Xb5nYw5NiO8[/video]
 
@Parafal

Add this line to your library/config.php file to increase the timeout:

Code:
ini_set('max_execution_time', 5000);

Hello @Jake Bunce

I included the code line in my config.php. Now the Post Contente Replacement Tool doesn't work.

If I check the box, after clicking to proceed, it automaticaly unchecks it. Nothing happens if I try to test or save.

Any other suggestion? :(

Thank you very much, I really appreciate your help on this matter.
 
Would it be possible to replace the following?

Code:
[URL='http://forum.com/gallery/files/2/4/pic4_original.jpg'][IMG]http://forum.com/gallery/files/2/4/pic4_thumb.jpg[/IMG][/URL]

with
Code:
[IMG]http://forum.com/gallery/files/2/4/pic4_original.jpg[/IMG]
 
Hi, I posted word Kanal in 3 continue post, now i want to change it with MatheyKanal, I try it as follow:

eyRxB9D.png


but found the following error:

wLe5ssZ.png


Any Idea?
 
You can just do a simple SQL query for that:

Code:
UPDATE xf_post SET message = REPLACE(message,'Kanal','MatheyKanal');

Take a backup first.
 
Has anyone done this coming from a MyBB forum?

Syntax is slightly different:
Code:
[video=youtube]https://www.youtube.com/watch?v=Xb5nYw5NiO8[/video]

Decided to learn regular expressions and just do it myself, for anyone else who is interested...

Quick Find:
Code:
#\[video=youtube\]http:\/\/www.youtube.com\/watch\?v=([^&\[]*)[^\[]*\[\/video\]#

Regular Expression:
Code:
#\[video=youtube\]http:\/\/www.youtube.com\/watch\?v=([^&\[]*)[^\[]*\[\/video\]#

Replacement String:
Code:
[media=youtube]\1[/media]
 
Calling on this wonderful community for help! What's the syntax to convert:

Code:
[MEDIA=ebay]itemid=331205773960[/MEDIA]

back into a normal ebay link, ala
Code:
http://www.ebay.com/itm/331205773960

Thanks!!!
 
Calling on this wonderful community for help! What's the syntax to convert:

Code:
[MEDIA=ebay]itemid=331205773960[/MEDIA]

back into a normal ebay link, ala
Code:
http://www.ebay.com/itm/331205773960

Thanks!!!

Quick Find:
Code:
[media
Regular expression:
Code:
#\[media=ebay]itemid=([0-9]+)\[/media]#siu
Replacement String:
Code:
http://www.ebay.com/itm/\1
 
Top Bottom