Resource icon

Post Content Find / Replace 1.0.0

No permission to download
It's the old vBulletin BBCode. The same from @Janmaat

http://www.xendach.de/resources/amazon-bb-code-by-janmaat.145/
Code:
<br>
<table border="0" cellspacing="4" cellpadding="0">
<tr>
<td><a href="http://www.amazon.de/exec/obidos/ASIN/{text}/xxx-21" target="_blank"><img src="http://images-eu.amazon.com/images/P/{text}.03.MZZZZZZZ.jpg" border="0"></a></td>
</tr>
<tr>
<td><strong>ASIN</strong>: <a href="http://www.amazon.de/exec/obidos/ASIN/{text}/xxx-21" target="_blank">{text}</a></td>
</tr>
</table>
<br>
Try this


Quick Find:
Code:
amazon
Regular expression:
Code:
#\[url](?:http://(?:www\.)?(amazon)\.(?:[a-z]+|[a-z]+\.[a-z]+)\/)(?:gp/offer-listing|gp/product|dp|exec/[a-z0-9]+/[a-z0-9]+/[a-z0-9]+)/([a-z0-9]+)/(?:[^\[]+)?\[/url]#siu
Replacement String:
Code:
[\1]\2[/\1]
 
Try this


Quick Find:
Code:
amazon
Regular expression:
Code:
#\[url](?:http://(?:www\.)?(amazon)\.(?:[a-z]+|[a-z]+\.[a-z]+)\/)(?:gp/offer-listing|gp/product|dp|exec/[a-z0-9]+/[a-z0-9]+/[a-z0-9]+)/([a-z0-9]+)/(?:[^\[]+)?\[/url]#siu
Replacement String:
Code:
[\1]\2[/\1]
It works fantastic!
Thx!
 
...Again this is untested as I don't have the time to make a boatload of tests at the moment but from first glace I believe this should fit for you.

Quick Find:
Code:
insidestocks

Regular expression:
Code:
#\(<u>(?:<a href="([^"]+)")[^>]+>(.*?(?!</a>?)?.)</a></u>\)(?:[^<]+)<i>(.*?(?!</i>?)?)</i>#siu

Replacement String:
Code:
([u][url='\1']\2[/url][/u]) [i](\3)[/i]

I get this

Server Error
preg_match_all(): Compilation failed: nothing to repeat at offset 45

  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 /var/www/vhosts/onlinetradersforum.com/httpdocs/admin.php at line 13
 
I get this

Server Error
preg_match_all(): Compilation failed: nothing to repeat at offset 45

  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 /var/www/vhosts/onlinetradersforum.com/httpdocs/admin.php at line 13
I just ran a quick test and it appears to work for me, unless you accidentally threw a stray character in there I would need to test it really quick on your server.


sgfgfdf.webp

For now I made a small edit to the original post that you quoted so go back to that and see if that edit works for you now. If that change didn't catch it I would need to take a look at from your site myself. Try it again and let me know what you get.
 
No the edit created the same error code

ok maybe the problem is my XXXXX stuff

the first and second XXXXX is the same thing, the third XXXXX is something else

so for instance it could be

Code:
(<u><a href="http://insidestocks.com/chart.asp?sym=ACAD&code=BCMM" target="_blank">ACAD</a></u>) <i>(Lightning Round)</i>

which should turn into

the BB code for that

or it could be

Code:
(<u><a href="http://insidestocks.com/chart.asp?sym=RH&code=BCMM" target="_blank">RH</a></u>) <i>(discussed)</i>

which would turn into the BB code for that

I should have indicated XXXX1 - XXXX2 - XXXX3 where XXXX1 and XXXX2 is the same

I had thousand of posts in a forum (admin written only) in HTML which did not import correctly so now the posts have the HTML showing instead of the result.

example here
http://onlinetradersforum.com/threa...s-mad-money-stock-picks-recap-11-8-12.656429/

weird I opened the post, looked at the code, saved and the link part of the post turned into BB code.

Here is what a post looks like without opening in Xenforo for first time and saving:

http://onlinetradersforum.com/threa...-mad-money-stock-picks-recap-10-16-12.655415/

and here is what the post should look like with the proper BB code

http://onlinetradersforum.com/threa...s-mad-money-stock-picks-recap-3-20-14.675526/
 
Last edited:
No the edit created the same error code

ok maybe the problem is my XXXXX stuff

the first and second XXXXX is the same thing, the third XXXXX is something else

so for instance it could be

Code:
(<u><a href="http://insidestocks.com/chart.asp?sym=ACAD&code=BCMM" target="_blank">ACAD</a></u>) <i>(Lightning Round)</i>

which should turn into

the BB code for that

or it could be

Code:
(<u><a href="http://insidestocks.com/chart.asp?sym=RH&code=BCMM" target="_blank">RH</a></u>) <i>(discussed)</i>

which would turn into the BB code for that

I should have indicated XXXX1 - XXXX2 - XXXX3 where XXXX1 and XXXX2 is the same

I had thousand of posts in a forum (admin written only) in HTML which did not import correctly so now the posts have the HTML showing instead of the result.

example here
http://onlinetradersforum.com/threa...s-mad-money-stock-picks-recap-11-8-12.656429/

weird I opened the post, looked at the code, saved and the link part of the post turned into BB code.

Here is what a post looks like without opening in Xenforo for first time and saving:

http://onlinetradersforum.com/threa...-mad-money-stock-picks-recap-10-16-12.655415/

and here is what the post should look like with the proper BB code

http://onlinetradersforum.com/threa...s-mad-money-stock-picks-recap-3-20-14.675526/


I'm tired...going to sleep...always run tests before running with 'save changes' checked


Quick Find:
Code:
insidestocks
Regular expression:
Code:
#\(<u><a href="(http://insidestocks[^?]+\?sym=([^&]+)\&code=([^"]+))[^>]+>[^<]+</a></u>\)[^<]+<i>\(([^)]+)\)</i>#siu
Replacement String:
Code:
([u][url='\1']\2[/url][/u]) [i](\4)[/i]
 
Sorry for pressing this over and over.

I see in phpmyadmin, a table called ( xf_bb_code_parse_cache) I'm thinking this has the url's cached in there which may be causing the soundcloud replacements to refresh embeded.

Can I empty this table without causing problems?
 
Sorry for pressing this over and over.

I see in phpmyadmin, a table called ( xf_bb_code_parse_cache) I'm thinking this has the url's cached in there which may be causing the soundcloud replacements to refresh embeded.

Can I empty this table without causing problems?

Yes.
 
Thanks, but I still didn't entered anything, I'm trying to access the tool options, but have only blank page.
 
If I want to replace all mentions of violinplayer to Mr. Five, how would I enter the regular expression and replacement string?

I'm changing a person's username and would like to fix the quotes and other mentions of that nick to correlate with the new username (Mr. Five).

Any help highly appreciated.
 
Last edited:
Replace in posts link in admin panel shows a blank page, is this mod working with XF 1.3 ?

I am guessing it's not installed correctly.

This directory should exist on the server:

library/PostReplace

And inside should be this:

library/PostReplace/addon_PostReplace.xml

That XML file needs to be imported in the Admin CP:

Admin CP -> Home -> Install Add-on
 
I am guessing it's not installed correctly.

This directory should exist on the server:

library/PostReplace

And inside should be this:

library/PostReplace/addon_PostReplace.xml

That XML file needs to be imported in the Admin CP:

Admin CP -> Home -> Install Add-on

Thanks jacke, this solved my problem.
 
Last edited:
Top Bottom