Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Hey,

if i try to install this addon (after copieng the folder into the library folder) i'm getting this error:

Server Error

unserialize(): Error at offset 3778 of 3966 bytes
  1. XenForo_Application::handlePhpError()
    [*]unserialize() in XenForo/Model/Template.php at line 1017
    [*]XenForo_Model_Template->compileTemplateInStyleTree() in XenForo/Model/Template.php at line 983
    [*]XenForo_Model_Template->compileNamedTemplateInStyleTree() in XenForo/Model/Template.php at line 923
    [*]XenForo_Model_Template->compileAllTemplates() in XenForo/CacheRebuilder/Template.php at line 55
    [*]XenForo_CacheRebuilder_Template->rebuild() in XenForo/ControllerHelper/CacheRebuild.php at line 26
    [*]XenForo_ControllerHelper_CacheRebuild->rebuildCache() in XenForo/ControllerAdmin/Tools.php at line 78
    [*]XenForo_ControllerAdmin_Tools->actionCacheRebuild() in XenForo/FrontController.php at line 310
    [*]XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 132
    [*]XenForo_FrontController->run() in /var/www/virtual/****/html/xf/admin.php at line 13
I'm using XF 1.1.4 :)
Thanks for helping
 
How would I use this to remove font and size bbcodes of all types?

so for example
Code:
[FONT=whateverhere]
and also the
Code:
[/FONT]
parts
 
To catch: [FONT=whateverhere]

Quick Find: FONT
Regular expression: #\[FONT\=[a-z]+\]#siu

_______________________________________

To catch [/FONT]

Quick Find: FONT
Regular expression: #\[/FONT\]#siu
 
Last edited:
I've tried this multiple times, nothing ever gets saved - it finds the posts with the code, however it doesn't save anything. I noticed it was an issue for other people in the first few pages of the thread, however Kier said it was fixed.

Maybe I'm missing something?
 
I've tried this multiple times, nothing ever gets saved - it finds the posts with the code, however it doesn't save anything. I noticed it was an issue for other people in the first few pages of the thread, however Kier said it was fixed.

Maybe I'm missing something?
Well what happened earlier in the thread was a small bug I think (not sure myself though) but assuming you have downloaded this addon after those were posted I would think the problem is something else.

My first inclination is thinking that you didn't have 'save changes' checked because I have done this myself too.
Untitled.webp
Make sure you have that checked and try it again.
 
You know I might be nuts but...

Xenforo has the same bbcode syntax for font I believe.

EXAMPLE = [FONT=impact]EXAMPLE[/FONT]

Is the post data you are trying to make replacements in from an import?
 
Yes it is, that doesn't change the fact that I still want to remove all font and size bbcodes.
 
This should work for you...

Quick Find: FONT

Regular expression: #\[FONT\=[a-z\s]+\](.+)\[/FONT\]#i

Replacement String: \1

make sure save changes is checked
 
Last edited:
That works but only finds like 6 posts - the previous one found thousands. Let me try that again. Thankyou very much for helping me out :)
 
I don't understand what's happening, the previous one now finds only 2 posts. Yesterday it was finding thousands (which is correct).

Can I just use MySQL syntax to do this? I don't understand why this tool doesn't work.

update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this string’, ‘replace found string with this string’);
What should I put in the "find this string" part to get ALL of the [font = anythinghere] instances?
 
What should I put in the "find this string" part to get ALL of the [font = anythinghere] instances?
That's the point, you need to use regex to cover all the instances.

Or, you can use simple SQL queries but you will have to do a separate query for every different instance.
 
I am sorry for my ignorance :) where should i upload the folders and so on ?
It's all good man.

Extract the zip and the upload the 'PostReplace' folder to the library folder of your xenforo installation and then install with the addon xml file from the acp.
 

Hey Jake, any idea how I can increase the allowed memory. I have to reduce the batch size to 1000 posts now and this is not going to work anymore like this.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1856 bytes)


Edit: Nevermind, I added the following to the top of that page to get rid of the out of memory and time error messages
<?php
ini_set( "memory_limit","4096M");
ini_set('max_execution_time', 300);
 
Back
Top Bottom