Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Do your posts contain actual HTML, like the string you posted?
HTML:
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/DWD5Jr4hS9I&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/DWD5Jr4hS9I&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>
If so, you could try this search expression:

Find:
Code:
#<object[^>]+>(<param[^>]+></param>)+<embed src="http://www.youtube.com/v/(\w+)[^"]+"[^>]+></embed></object>#siU
Replace:
Code:
[media=youtube]\2[/media]
I haven't tested that, but it should work.

It found all the post, but when I clicked on save it replaced everything with a
Code:
[media=youtube]A # OR LETTER HERE[/media]

I'm guessing that can't be fixed now!
 
It found all the post, but when I clicked on save it replaced everything with a
Code:
[media=youtube]A # OR LETTER HERE[/media]

I'm guessing that can't be fixed now!
I hope you did this after performing a backup of your post table? I actually have no idea how you could have ended up with that 'A # OR LETTER HERE' text.
 
This is fantastic!

I have cleaned up a lot of my code, but I need regex help to make my quote bbcode correct, if anyone can help.

My old quote style was:
[quote name='username' timestamp='1281747597' post='387243']

What I would like to replace this with is:
[ quote="username" ]

(without the spaces around the braces)

Can anyone help with this regex?
 
I have a lot of posts, so this error may not be occuring for everyone.

I get:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 43 bytes) in /home/[removed]/public_html/library/Zend/Db/Statement/Mysqli.php on line 304
 
Interestingly, increasing the memory allocated to PHP and restarting apache doesn't seem to affect this error.
 
Interestingly, increasing the memory allocated to PHP and restarting apache doesn't seem to affect this error.
Try disabling the memory_limit setting in libary/Application.php and try again (just comment it out)
 
sorry for being so dense, but I don't see library/Application.php?
Oops, sorry
redface.png
 
Up the memory limit? Try setting memory_limit to 128M or something high like that.
 
Up the memory limit? Try setting memory_limit to 128M or something high like that.
OK, in Application.php, I would change this line (I assume) to what?
Code:
        @ini_set('memory_limit', 128 * 1024 * 1024);
        ignore_user_abort(true);
 
@ini_set('memory_limit', 8*1024*1024*128); would give you a limit of 128MB.
Nope. Went to this:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 16 bytes) in /home/glorify/public_html/new/forums/library/Zend/Db/Statement/Mysqli.php on line 294
 
Well, I left it at 128, and tried a test first, THEN it converted after. It wouldn't do it all at once. Thanks Kier.
 
This is awesome, Kier. I had some issues after using AME, and later on uninstalling it. A few dozen posts were left with broken tags.

With this, I can fix those errors when I finally make the live switch, and never have to worry about it again. Two thumbs up :)
 
Kier this addon is awesome. I was wondering is it technically possible to do something whereby it can be configured and set to run as a cron job?

My logic here is that say for example someone posted a http://www.youtube.com/watch?v=UrbHykKUfTM link (that's for new X-Men trailer btw), a board admin could set up a cron that switches out the URL for the media tag, effectively XenForo sorts out daft posts automatically.

If it were possible, then I think something like this could also potentially be used by those wanting a RegEx swear filter. It could also be used to replace bad links in posts.

In the alternative maybe it would be possible to have XenForo apply RegEx's from a list when people actually submit their posts?

I know it's cheeky just to ask here but I'm clueless when it comes to coding and having managed to open up XenForo in Eclipse my brain hurt :(
 
Top Bottom