Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Now I'm getting this error:

Code:
An exception occurred: Mysqli prepare error: MySQL server has gone away in /public_html/library/Zend/Db/Statement/Mysqli.php on line 77
 
Last edited:
EQnoble

I'm stuck with these:
Code:
[IMG]http://graemlins/thumbup.gif[/IMG]

I have about 5000 broken. How do I get rid of these?

http://recording.org/index.php?threads/more-g9-troubleshooting.44504/#post-343436

http://recording.org/index.php?threads/motown-influences.4165/#post-32544


.
I need more information than that buddy, optimally I need enough examples in that code box so that I can derive some sort of pattern as to what you want removed or modified or whatever...

Do you want all gifs removed, only gifs from certain sites...one site, any kind of image from graemlins....its a lot for me to guess from and then write up an expression hoping it covers you without scratching up all your vinyl.


For right now...I need sleep....it's been a long day.
 
I need more information than that buddy, optimally I need enough examples in that code box so that I can derive some sort of pattern as to what you want removed or modified or whatever...

Do you want all gifs removed, only gifs from certain sites...one site, any kind of image from graemlins....its a lot for me to guess from and then write up an expression hoping it covers you without scratching up all your vinyl.


For right now...I need sleep....it's been a long day.

You have a good night.!

I like that " without scratching up all your vinyl" I'll keep that saying. ;)

I realize I'm giving you a lot here. So, anything you can do for me is most appreciated. Maybe I'll figure out how to do it after a few more examples.

The graemlins are the most populated on my forum so if I can get rid of them, cool.

Code:
[IMG]http://graemlins/beerchug.gif[/IMG]
[IMG]http://graemlins/wave.gif[/IMG]
[IMG]http://graemlins/thumbup.gif[/IMG]
[IMG]http://graemlins/silly.gif[/IMG]
[IMG]http://graemlins/duh.gif[/IMG]
[IMG]http://graemlins/peace.gif[/IMG]

[IMG]http://tongue.gif[/IMG]
[IMG]http://smile.gif[/IMG]
 
Last edited:
Quick Find:
Code:
graemlins
Regular expression:
Code:
#\[IMG]http://graemlins/(?:[^\.]+)\.gif\[/IMG]#siu
Replacement String:
Code:

For the other two at the end, they look weird and without knowing what else on your board may have a url that is just a filename.extension I don't want to give you an expression that can remove things you didn't intend to.
 
Quick Find:
Code:
graemlins
Regular expression:
Code:
#\[IMG]http://graemlins/(?:[^\.]+)\.gif\[/IMG]#siu
Replacement String:
Code:

For the other two at the end, they look weird and without knowing what else on your board may have a url that is just a filename.extension I don't want to give you an expression that can remove things you didn't intend to.

Comes up blank.
 
I find 7000 of them with this: but it won't work with http://

Code:
[IMG

Code:
#\[IMG](?:[^\.]+)\.gif\[/IMG]#siu
 
Quick Find:
Code:
graemlins
Regular expression:
Code:
#\[IMG]http://graemlins/(?:[^\.]+)\.gif\[/IMG]#siu
Replacement String:
Code:

For the other two at the end, they look weird and without knowing what else on your board may have a url that is just a filename.extension I don't want to give you an expression that can remove things you didn't intend to.

EQnoble,

Why do you think the regex won't resolve
Code:
http://
before graemlin/ ?
 
EQnoble,

Why do you think the regex won't resolve
Code:
http://
before graemlin/ ?
It could not be matching for many reasons one of which is what you posted up for me to match may not be what you see when using the bbcode editor view when clicking edit on a post, another is you are trying match things which can not be accounted for by what you originally requested.

As far as your original request...if what you supplied in your example is what you are trying to replace than that expression will catch it....

(I am thinking that what you posted as an example is not what you are trying to change, click edit on one of the posts containing that string and then hit the button that looks like a wrench on a piece of paper on the right hand side of the editor)

hgfhgfdgh.webp

A general message to everyone:

If you don't really understand regex at least in basic form you should not be modifying other's expressions...like as a rule of thumb if you cant read the expression and understand what it is saying and like in @audiokid 's case finds 7000 results you should just not do anything with it because unless you are going to check all 7000 replacements before saving changes you really don't know what your expression is matching and therefor what you will end up with...and to that you could end up ruining half of your posts table.
 
I understand what you are saying but, its like the h t t p in this particular graemlin IMG string is not searchable in regex. Like a rewrite that has been injected or something. Which is concerning and why I want to remove them all.
I can find most everything I look for using this regex, with the exception to all these graemlins. They were added some how years back in my forum and I've never understood how..

If I attach the h t t p to your code, they will not appear. if I remove the h t t p, they appear.
 
It could not be matching for many reasons one of which is what you posted up for me to match may not be what you see when using the bbcode editor view when clicking edit on a post, another is you are trying match things which can not be accounted for by what you originally requested.

As far as your original request...if what you supplied in your example is what you are trying to replace than that expression will catch it....

(I am thinking that what you posted as an example is not what you are trying to change, click edit on one of the posts containing that string and then hit the button that looks like a wrench on a piece of paper on the right hand side of the editor)

View attachment 70677

A general message to everyone:

If you don't really understand regex at least in basic form you should not be modifying other's expressions...like as a rule of thumb if you cant read the expression and understand what it is saying and like in @audiokid 's case finds 7000 results you should just not do anything with it because unless you are going to check all 7000 replacements before saving changes you really don't know what your expression is matching and therefor what you will end up with...and to that you could end up ruining half of your posts table.


To add, this is exactly what I did before I requested your help. I find 7100 of these in my forum. All like the image you've attached. When I click the wrench to read the code, they are exactly like that.
 
I need to see it for myself on your site, as it is now what you are explaining makes no sense, the image I posted shows that if the way it appears there is actually written in your posts that it would catch those.
 
Hi @EQnoble ,

I need to change a set url on the site to another however I also need to replace the subfolders for example I need:

www.X.com/community/attachments/ks4cit01-pdf.66543/

to become

www.Y.com/attachments/ks4cit01-pdf.66543/

How do I complete this with the addon?

I've tried to do it but get either a Fatal error: Allowed memory size of 67108864 bytes exhausted
or
Server Error
preg_match_all(): No ending matching delimiter ']' found

  1. XenForo_Application::handlePhpError()
  2. preg_match_all() in PostReplace/ControllerAdmin/PostReplace.php at line 26
  3. PostReplace_ControllerAdmin_PostReplace->actionReplace() in XenForo/FrontController.php at line 347
  4. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  5. XenForo_FrontController->run() in /home/carpedie/public_html/admin.php at line 13
Thanks
 
I think that has to do more with the location of the forum on your server and some ACP settings, doesn't it? This add-on finds and replaced various content only within posts. Unless I am not understanding your question.

Edit. I think I see now. You have posts that reference the old locations and you need to change all those after going the site URL and structure - correct?
 
Hi @EQnoble ,

I need to change a set url on the site to another however I also need to replace the subfolders for example I need:

www.X.com/community/attachments/ks4cit01-pdf.66543/

to become

www.Y.com/attachments/ks4cit01-pdf.66543/

How do I complete this with the addon?

I've tried to do it but get either a Fatal error: Allowed memory size of 67108864 bytes exhausted
or
Server Error
preg_match_all(): No ending matching delimiter ']' found

  1. XenForo_Application::handlePhpError()
  2. preg_match_all() in PostReplace/ControllerAdmin/PostReplace.php at line 26
  3. PostReplace_ControllerAdmin_PostReplace->actionReplace() in XenForo/FrontController.php at line 347
  4. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  5. XenForo_FrontController->run() in /home/carpedie/public_html/admin.php at line 13
Thanks


The first error is because you have more replacements to make than your servers memory can handle in one shot. You can either increase your memory (which may not help you at all depending how many replacement you need to make per expression), or you can follow Jake's mod for this addon which will add a batch processor type of function so that it won't try to do more than it can per run.


The second error is because you are not using an ending delimiter, when dealing with regex think of a delimiter as a border marker to tell your server to either start treating the following as regex or to tell it to stop interpreting it at regex. Even when you follow a plain text match in regex you still need delimiters for your server to know to treat a string as regex, like you might want to match the word hungry and though it seems pointless you really need to wrap it with delimiters like this #hungry# (I use # for delimiters but there are others that can be used) For that try fixing your expression so that it is wrapped on both sides with #.


As far as your actual needed expression goes...when requesting help in this thread the best way to go about it is to open an example post at your forum, click edit, then click use bbcode editor (icon that looks like a wrench over a piece of paper). What you see when editing with the bbcode editor is what I actually need to see in order to make someone a proper expression for their board.
 
Just moved a site to a new domain and this has been really helpful in changing links. Thanks (for the add-on and for the regex examples in the thread). (y)
 
Top Bottom