Resource icon

Post Content Find / Replace 1.0.0

No permission to download
@Allyra Use this.

Find: /“/siU
Replace:

Find: /”/siU
Replace:

Find: /‘/siU
Replace:

Find: /’/siU
Replace:

If you rather to use single and double quotes instead then you can minimize the quires.

Find: /“|”/siU
Replace: "

Find: /‘|’/siU
Replace: '
 
Hi,

I have moved my forum from; domain1.com/ to domain2.com/discussion/

What do I write to fix the URLS in threads that users have written when they have linked to another discussion?
 
it can be done using mysql/phpmyadmin. i have used a command like this multiple times in the past.

SQL:
UPDATE xf_post SET message = REPLACE(message, 'domain1.com', 'domain2.com/discussion');

of course... take a backup and do it on your own risk. maybe someone else could confirm if this command is safe to run.
 
it can be done using mysql/phpmyadmin. i have used a command like this multiple times in the past.

SQL:
UPDATE xf_post SET message = REPLACE(message, 'domain1.com', 'domain2.com/discussion');

of course... take a backup and do it on your own risk. maybe someone else could confirm if this command is safe to run.

That's the way I did it and it was fine.

Also with my Wordpress site.
 
Hello,
After we converted to xenforo
Some fonts have resized and become small in some posts
They can be manually modified and resized to the largest but they are too many
Is there any help to change them all to the larger?

Eg font
arial
How larger the size to the largest ?
 
For anyone having problems matching strings that span multiple lines, you need to use the s switch on your regex to allow this to work.

For example, a reflex to find the following:

Rich (BB code):
[quote]
[B]Originally posted by Someone[/B]

Would look like this:

Code:
/\[quote\]\s*\[b\]originally posted by (.+)\[/b\]/siU
Note that I’m using a case-insentitive (i), multi-line (s) regex that is also ungreedy (U), so it will stop matching at the first [/b] that it comes across.
[/QUOTE]
Evening all. Gosh... okay,
How would that work in actual text example please?
I.E where do you put the post by 'someone' in the text?
I have had to change a username and need to rename all existing posts. Would be grateful if someone could show me how to please.
Thank you
 
I've tried this and it doesn't do anything after clicking save. Anyone else encountered the same issue?
Does anyone know the query to change usernames in quotes etc?
 
I'm getting this error when using this - how can I solve it? Thanks.
ErrorException: [E_WARNING] preg_match_all(): Empty regular expression in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
  1. XF::handlePhpError()
  2. preg_match_all() in src/addons/XFPR/Admin/Controller/PostReplace.php at line 41
  3. XFPR\Admin\Controller\PostReplace->actionReplace() in src/XF/Mvc/Dispatcher.php at line 249
  4. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  5. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  6. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1931
  7. XF\App->run() in src/XF.php at line 328
  8. XF::runApp() in admin.php at line 13
 
The regex should be something like this
Code:
#(\[url]https:\/\/my-forum\.com\/threads\/)([0-9]+)\&highlight\=keyword\+keyword2(\[\/url])#siu
Replacement:
\1\2\3

Always test first

There're some mistakes e.g. unescaped square brackets, also you didn't have to include the url tag at all.


try this:

Search: #(https://my-forum\.com/threads/)(\d+).*#siU
Replace: \1\2
 
Hello. I think this add-on can work great for replacing broken links on our site.
I am having a first go at it, and struggling to get it to work.

Regular expression:
Code:
\[url=('|")?http[s]?:\/\/uberpeople\.net\/x\-apple\-data\-detectors:\/\/([0-9]+)('|")([-a-zA-Z0-9:%_\+\.~\!\$\^#\?&\/='"]+)\[\/url\]

Error:
Code:
Server Error
preg_match_all(): Unknown modifier '\'

XenForo_Application::handlePhpError()
preg_match_all() in PostReplace/ControllerAdmin/PostReplace.php at line 26
PostReplace_ControllerAdmin_PostReplace->actionReplace() in XenForo/FrontController.php at line 369
XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 152
XenForo_FrontController->run() in /home/uberpeop/public_html/admin.php at line 13

postreplace.webp
 
I realize this is old, but I'm hoping to get some assistance. I performed an import from PHPBB, into XF 1.5. This means I can still install this add-on, and it looks like just what I need to clean some stuff up.

So here's an example post after the import:



<QUOTE author="TO SUMMARIZE"><s>[quote="TO SUMMARIZE"]</s><COLOR color="red"><s>[color=red]</s><B><s>[b]</s>MAX HEIGHT: 200 Pixels<br/>
MAX WIDTH: 500 Pixels<br/>
MAX SIZE: 100Kb<e>[/b]</e></B><e>[/color]</e></COLOR><e>[/quote]</e></QUOTE>

I did a bunch of UPDATE statements in the database, and cleaned up a ton already, but I'm stumped about the regex to remove all colors and quotes (as you can see, there are XF BBCode tags already, so all left to do is to remove the old tags altogether).

I tried various things, and think I have what I need. Could someone confirm if this gets rid of any color tag, regardless of what color selection is between the double quotes?

(<COLOR color=\")([^\s]+\"\>)

This won't work for the QUOTE bit though, due to the whitespace in there. How would address that, and allow for any amount of words between those double quotes?

Thanks :)
 
Back
Top Bottom