Resource icon

Post Content Find / Replace 2.0.1

No permission to download
Post content find replace addon.
I didn't understand your answer.
As I understand it, you need to create a regular expression to delete messages on the forum containing this content.
Question: how to create a regular expression?
 
How to remove BB codes of this type using this plugin: [MSNAPBACK]694562[/MSNAPBACK]
However - without waranty at your one risc. Make sure you have a backup first bevore you try this!

Quick find:
Code:
[MSNAPBACK]

RegEx:
Code:
#(\[MSNAPBACK\](\d+)\[\/MSNAPBACK\])#si

Replacement String
Code:

1708585879694.webp

You can test it at no risk in a regex tester like this:
Also you can read/search in this thread - there are so many examples that helps novices to.


Post content find replace addon.
Sorry, but thats a litle bit stupid to answer like this in this thread. Dont you mean?! ;)
 
RegEx is not so complicated as it shines. ;-)
Its logical and well documented.
And you find online realy good sites to trainee your skills and test your regex. First steps are hard but it will be lighter and lighter with the time. :-)
 
i have error
Code:
ErrorException: [E_WARNING] preg_match_all(): Empty regular expression in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
XF::handlePhpError()
preg_match_all() in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
XFPR\Admin\Controller\PostReplace->actionReplace() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 259
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2483
XF\App->run() in src/XF.php at line 524
XF::runApp() in admin.php at line 13
 
/\[video\=youtube\;(.*?)\]/i seems to work 🙏
We just had to replace a few broken youtube links so these are the settings we used:
Code:
Quick Find: video=youtube
Regular expression: #\[video=youtube;([a-zA-Z0-9_\-]+)\]http[^\[]+\[/video\]#siU
Replacement String: [media=youtube]\1[/media
 
Last edited:
How could I use this add-on, if possible, to strip users affiliate links from ebay links?

Affiliate links that typically look like something like this:
HTML:
https://www.ebay.com/itm/226175681364?itmmeta=01J00DZDF8ZHJF2RT9GHKKRHQQ&hash=item34a91f0354:g:cjcAAOSwluBmVMux&itmprp=enc%3AAQAJAAAA4PW8V%2FwHOBAcwAhRVcjYyDqhm6tgUEfRh9o1fYD9zty0qqgW48hP9uPrX5Tfuv8RUlj8ESXjil2Chx936P7NpyIOJUsOhY0ZYMpVsOUoK%2FYQoFNYTOFqzsGp9ac7qGYlUsJsu%2FhqCS4F7O094emBlvw9o4VUHTeT6rd8II%2FeuJIgcc2mbNJOMCRKAsCCmzKwkZujUb9NusPKXomiYauuj%2B0%2FI6y1FlNEcltaDFKPZ2NIy%2F3%2BSCK9dtTJxvjbKtyti2mZpwkk%2F082XxEmaUeW0gZE62d%2F3Nm1B6nHY7yF40IG%7Ctkp%3ABk9SR9rX_Y2AZA&mkcid=1&mkrid=711-53200-19255-0&siteid=0&campid=5338071934&customid=&toolid=10001&mkevt=1&mkcid=1&mkrid=711-53200-19255-0&siteid=0&campid=5336785883&customid=&toolid=10001&mkevt=1

And make the link instead be:

HTML:
https://www.ebay.com/itm/226175681364
 
How could I use this add-on, if possible, to strip users affiliate links from ebay links?

Affiliate links that typically look like something like this:
HTML:
https://www.ebay.com/itm/226175681364?itmmeta=01J00DZDF8ZHJF2RT9GHKKRHQQ&hash=item34a91f0354:g:cjcAAOSwluBmVMux&itmprp=enc%3AAQAJAAAA4PW8V%2FwHOBAcwAhRVcjYyDqhm6tgUEfRh9o1fYD9zty0qqgW48hP9uPrX5Tfuv8RUlj8ESXjil2Chx936P7NpyIOJUsOhY0ZYMpVsOUoK%2FYQoFNYTOFqzsGp9ac7qGYlUsJsu%2FhqCS4F7O094emBlvw9o4VUHTeT6rd8II%2FeuJIgcc2mbNJOMCRKAsCCmzKwkZujUb9NusPKXomiYauuj%2B0%2FI6y1FlNEcltaDFKPZ2NIy%2F3%2BSCK9dtTJxvjbKtyti2mZpwkk%2F082XxEmaUeW0gZE62d%2F3Nm1B6nHY7yF40IG%7Ctkp%3ABk9SR9rX_Y2AZA&mkcid=1&mkrid=711-53200-19255-0&siteid=0&campid=5338071934&customid=&toolid=10001&mkevt=1&mkcid=1&mkrid=711-53200-19255-0&siteid=0&campid=5336785883&customid=&toolid=10001&mkevt=1

And make the link instead be:

HTML:
https://www.ebay.com/itm/226175681364
In case anyone is looking for the solution to this, I think I found one:

Quick Find:
Code:
ebay.com/itm

Regular expression:
Code:
#\[URL='(https://www\.ebay\.com/itm/[^?]+)\?[^']*'\](.*?)\[/URL\]#i

Replacement string:
Code:
[URL='\1']\2[/URL]
 
Code:
ErrorException: [E_WARNING] preg_match_all(): Empty regular expression in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
XF::handlePhpError()
preg_match_all() in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
XFPR\Admin\Controller\PostReplace->actionReplace() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 258
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2485
XF\App->run() in src/XF.php at line 524
XF::runApp() in admin.php at line 13
 
I'm not sure if I can do what I'm trying to do with this tool.... I need to replace signatures that have an old custom BB code from Xenforo 1:
Code:
[img=Citizen of the Order (15p)]https://wwww.example.com/r3.jpg[/img]

Code:
[IMG title="Citizen of the Order (15p)"]https://wwww.example.com/r3.jpg[/IMG]

It seems like I need the ability to replace multiple parts... still possible?
 
@Chris D can you check this error?

Code:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 446464 bytes) in /home/***/public_html/sosyal/src/XF/Db/Mysqli/Statement.php on line 88

PHP memory limit upgraded error:

Code:
Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in /home/***/public_html/sosyal/src/XF/Db/AbstractStatement.php on line 106

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 16384 bytes) in /home/***/public_html/sosyal/src/XF/Db/Mysqli/Statement.php on line 37
 
Relating to the following discussion:

I'm trying to remove these remnant viglinks that still exist long after I've uninstalled the VigLink add on. This post explains why they're still showing up:

In any event, the VigLinks look like this:
Code:
https://redirect.viglink.com/?format=go&jsonp=vglnk_172485894788610&key=b617ddd562e3b6e9c916999f0745de59&libId=m0e0hccj01000b3h000ULqfqvkczaz3jp&loc=https%3A%2F%2Fpontiacforum.com%2Fpontiac%2Fthreads%2F1998-2002-y87-firebird-identification.39586%2F%23post-117590&v=1&opt=true&out=http%3A%2F%2Fi.viglink.com%2F%3Fkey%3D2ecd8bc9fcc7034251aad35a31b16337%26insertId%3Defd9b8a17188ef61%26type%3DM%26exp%3D60%253ACI1C55A%253A1%26libId%3Dk8agt6is01000b3w000MAbwxxrs7l%26loc%3Dhttps%253A%252F%252Fcamaroforums.com%252Fforum%252F93-02-v6-tech-14%252F3800-performance-package-y87-40820%252F%26v%3D1%26iid%3Defd9b8a17188ef61%26opt%3Dtrue%26out%3Dhttp%253A%252F%252Fwww.ebay.com%252Fsch%252FeBay-Motors-%252F6000%252Fi.html%253F_from%253DR40%2526_nkw%253Drear%252Bbrakes%26ref%3Dhttps%253A%252F%252Fwww.google.com%252F%26title%3D3800%2520performance%2520package%2520(y87)%2520-%2520Camaro%2520Forums%2520-%2520Chevy%2520Camaro%2520Enthusiast%2520Forum%26txt%3D%253Cspan%253Erear%2520%253C%252Fspan%253E%253Cspan%253Ebrakes%253C%252Fspan%253E&title=(68)%201998%202002%20Y87%20Firebird%20identification%20%7C%20Pontiac%20Owners%20Group&txt=rear%20brakes

I'm trying to figure this out myself but am not having any luck. What should I be using for the items below?

Quick Find:
Regular Expression:
Replacement String:

Whatever I'm trying gives me the following error:

ErrorException: [E_WARNING] preg_match_all(): Delimiter must not be alphanumeric, backslash, or NUL in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41

XF::handlePhpError()
preg_match_all() in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
XFPR\Admin\Controller\PostReplace->actionReplace() in src/XF/Mvc/Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 258
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2485
XF\App->run() in src/XF.php at line 524
XF::runApp() in admin.php at line 13
 
Back
Top Bottom