Resource icon

Post Content Find / Replace 1.0.0

No permission to download
OK, here's (hopefully) a simple replacement. If I can get the syntax for this example, I can fix tons of smilies..

Text to replace
Code:
 :thumbup1:

New smiley:
Code:
 (y)
 
OK, here's (hopefully) a simple replacement. If I can get the syntax for this example, I can fix tons of smilies..

Text to replace
Code:
 :thumbup1:

New smiley:
Code:
 (y)

Doh! I just remembered I could simply add the old smiley replacement onto the new smiley to fix this.
 
from:
Code:
[media=soundcloud]

to:
Code:
[media=soundcloudembed]

Please could you help me with the regular expression I don't know what this is.

Thanks Kindly
 
I haven't figured out how to fix these either.

I'm having trouble with these guys

Code:
[URL]http://www.marca.com/?d=74FPEVFL[/URL]
[URL='http://www.marca.com/es/?d=CO980GLE']Capítulo 1:El Autobot Spike[/URL]
[URL='http://www.marca.com/es/?d=QOSC74G7']Capítulo 2:Cambiando a Gears[/URL]
[URL='http://www.marca.com/?d=M138WOTQ']Capítulo 3: La ciudad de acero[/URL]
[URL='http://www.marca.com/es/?d=6YRNO71Z']Capítulo 4:El ataque de los Autobots [/URL]

So far this is what I've trid with no luck

Quick Find:
Code:
marca

Regular expression:
Code:
#(\[URL)(])(http://www.marca.com/\?d=)([^]]+)(\[/URL])#siu

Replacement String:
Code:
\1='\3\4'\2Link Removed\5


Quick Find:
Code:
marca

Regular expression:
Code:
#(?:\[URL='http://www.marca.com/\?d=[^']+'])((?:.*?(?!\[/URL]?)).)(?:\[/URL])#siu

Replacement String:
Code:
\1
 
I noticed that this one leaves a "Last edited by a moderator" on every post where it applies a replacement! I think it's a big deal... I even believe that it's a bug!

@Kier or @Mike could you please let us know how to prevent this behavior?
 
Hi, is this addon still working, i see an error after installation. it says "The requested page could not be found." after i click the link

i uploaded all the folders into root directory and installed with the xml file, is that correct?

error.webp
error1.webp
 
Hello: I used this plugin to replace my youtube links and it worked very well. Thanks a lot for that.

Now the next problem I have are the links broken of my own site. I had VbSeo in my old site, then they had the structure:
<domain>/<foro>/<sub-forum>/<thread-id>-<thread-title><.html>

Example: http://acuarios.desdecostarica.com/foro/ovoviv-paros/13969-quiero-reproducir-guppys-ayuda.html

Actually in Xenforo this same link is:

http://acuarios.desdecostarica.com/foro/threads/quiero-reproducir-guppys-ayuda.13969/

As you can see http://acuarios.desdecostarica.com/foro/ovoviv-paros/ can be easily replaced by http://acuarios.desdecostarica.com/foro/threads/ using an update statement (I should have to do it with every subforum, and I have a lot of them :oops: )

But I don't get how to change 13969-quiero-reproducir-guppys-ayuda.html into quiero-reproducir-guppys-ayuda.13969/.

Can I change the whole URL links using this? Do you know how to do it?

Read through 42 pages without any luck on this (Youtube fix worked great)! I also need help this this. VB +VBSEO to XF

http://www.xyz.com/sub-fourm-abc/12345-thread-title-here.html

convert to

http://www.abc.com/threads/12345

and also

http://www.xyz.com/sub-fourm-abc/12345-thread-title-here.html#post841904

to

http://www.abc.com/posts/841904

Also just found very old code (I think from phpBB)

http://www.xyz.com/forum/viewtopic.php?f=47&t=28
to
http://www.abc.com/threads/28

Edit: Last one more

http://www.xyz.com/forum/viewtopic.php?f=48&t=37&p=230#p222
to
http://www.abc.com/posts/222
 
Last edited:

What are you converting to? The links you are trying to create look nothing like XF links.

http://www.abc.com/threads/28
http://www.abc.com/posts/222


for instance this is this posts link

http://xenforo.com/community/threads/post-content-find-replace.6548/page-42#post-814055
 
What are you converting to? The links you are trying to create look nothing like XF links.

http://www.abc.com/threads/28
http://www.abc.com/posts/222


for instance this is this posts link

http://xenforo.com/community/threads/post-content-find-replace.6548/page-42#post-814055
http://xenforo.com/community/posts/814055 does redirect to http://xenforo.com/community/threads/post-content-find-replace.6548/page-42#post-814055

I thought that would be the easiest since getting the actual URL from the xenforo friendly URL will be challenging?
 
Hi, what will be the regular expression for
Code:
http://bayanulquran.com/images/ani008.gif
to replace with
Code:
http://alkamunia.com/images/ani008.gif

Thanks in advance :)
 
Trying to perform a search and replace for AME posts to Media instead, however when I run the addon I get the following error:

"Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/domain/public_html/forum/library/Zend/Db/Statement/Mysqli.php on line 304"

I'm not sure if it's related but I've tried to change the PostReplace.php file with @Jake Bunce's suggested change here, this however gets rid of the error but the only thing that appears to happen is a page refresh. No count down or up, results, and the posts are still the same.

Any suggestions?
 
Trying to perform a search and replace for AME posts to Media instead, however when I run the addon I get the following error:

"Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 72 bytes) in /home/domain/public_html/forum/library/Zend/Db/Statement/Mysqli.php on line 304"

I'm not sure if it's related but I've tried to change the PostReplace.php file with @Jake Bunce's suggested change here, this however gets rid of the error but the only thing that appears to happen is a page refresh. No count down or up, results, and the posts are still the same.

Any suggestions?

That modification you linked should work to decrease the memory usage. I would reiterate what I said in that post:

The idea here is that you would run each replacement multiple times until it matches zero posts which means it has done them all.

Otherwise you need to increase the memory_limit in PHP. These methods don't always work, but try adding this to your library/config.php file:

Code:
 ini_set('memory_limit', -1);

Or add this to a .htaccess file on your server (only works on Apache servers):

Code:
 php_value memory_limit -1
 
That modification you linked should work to decrease the memory usage. I would reiterate what I said in that post:

"The idea here is that you would run each replacement multiple times until it matches zero posts which means it has done them all."

Yes I understand that part, but wouldn't your mod show some kind of numbers or posts completed? Like "1-500, 500-1000..." as it is right now I run the search/replace and and the page simply refreshes. No other indication that anything even happened.
 
Yes I understand that part, but wouldn't your mod show some kind of numbers or posts completed? Like "1-500, 500-1000..." as it is right now I run the search/replace and and the page simply refreshes. No other indication that anything even happened.

On every refresh it will show the number completed. For example, if you have 12500 posts to process and the limit is 5000 then you will refresh 3 times. The first time will show 5000. The second time will show 5000. The third time will show 2500.
 
On every refresh it will show the number completed. For example, if you have 12500 posts to process and the limit is 5000 then you will refresh 3 times. The first time will show 5000. The second time will show 5000. The third time will show 2500.
And thus the point I'm trying to make. I click on "Proceed" and then page reloads as if it was going to do something but nothing does nor is there a counter of any type...
tHylMwi.png
 
Top Bottom