Resource icon

Post Content Find / Replace 1.0.0

No permission to download
Quick find:
I am getting this error:

preg_match_all(): Delimiter must not be alphanumeric or backslash
  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 351
  4. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  5. XenForo_FrontController->run() in /public_html/admin.php at line 13
 
I would also like to know how to replace all instances of:
[NOPARSE]
with the xenforo counterpart [ PLAIN] (without the space)
Does anyone know how?
 
Would appreciate some regex assistance please.

Replace:
Code:
[URL='http://old.postimage.org/image.php?v=Pq3EW8y9'][ATTACH=full]83646[/ATTACH][/URL]

With:
Code:
[URL='http://old.postimage.org/image.php?v=Pq3EW8y9']http://old.postimage.org/image.php?v=Pq3EW8y9[/URL]

where 'Pq3EW8y9' could be any value.

So far I have ....
Quick Find:
Code:
postimage
Regex:
Code:
/\[URL='(http:\/\/old.postimage.org\/image.php\?v=.+)']\[ATTACH=full].+\[\/ATTACH]\[\/URL]/i
Replace:
Code:
[URL='$1']$1[/URL]
... but this fails to find any matches. Despite working/matching at https://regex101.com/
 
Last edited:
To comply with certain DMCA's, I have to mass remove links from my community. Censoring doesn't help in this case as it only censors the domain and the censor can be replaced with the domain name to reach the content.

These are domains, and all links from these domains need to be removed.

So for example, I have
https://xenforo.com/community/threads/post-content-find-replace.6548/
https://xenforo.com/community/threads/post-content-find-replace.6548/page-63

These two links in different threads of my site,

I want to target [can be http/https]xenforo.com/<anything after this> and replace it with <LINK REMOVED>

What would be the expression for this?
 
After phpbb import, i have thousands of posts where line breaks are replaced by <br> tag (as string in the post text).
Those posts are automated posts from a RSS feed
Is there a way to use this addon to replace the <br> tags in the post to real line breaks ? What replacement should i use ? Should i replace with \n \b or it will just be parsed as string in the post ?

Also wondering if i should configure it to find <br> or it's html-encoded value :
Code:
&lt;br&gt;

ffdd8fcf9001496db966dc9ddc704260.png
 
After phpbb import, i have thousands of posts where line breaks are replaced by <br> tag (as string in the post text).
Those posts are automated posts from a RSS feed
Is there a way to use this addon to replace the <br> tags in the post to real line breaks ? What replacement should i use ? Should i replace with \n \b or it will just be parsed as string in the post ?

Also wondering if i should configure it to find <br> or it's html-encoded value :
Code:
&lt;br&gt;

ffdd8fcf9001496db966dc9ddc704260.png

Ok so i did a lot of testings but i still need help

finding/matching <br> tags in posts is easy i just have to search for
Code:
\<br\>

The problem is that it looks impossible to replace this string with a line break...

Here's the replacements i tried
  • \n - doesn't work, parsed as string in the posts
  • \r\n - same thing
  • <br/> - doesn't work, the html is parsed as string in the posts
  • &#10; - it's the HTML entity code for a line break, but again it's parsed as string in the posts
  • Alt+013 Alt+010 - keyboard code supposed to produce a "line break" character. Does nothing.
 
To comply with certain DMCA's, I have to mass remove links from my community. Censoring doesn't help in this case as it only censors the domain and the censor can be replaced with the domain name to reach the content.

These are domains, and all links from these domains need to be removed.

So for example, I have
https://xenforo.com/community/threads/post-content-find-replace.6548/
https://xenforo.com/community/threads/post-content-find-replace.6548/page-63

These two links in different threads of my site,

I want to target [can be http/https]xenforo.com/<anything after this> and replace it with <LINK REMOVED>

What would be the expression for this?
Can someone please help me with this? :( It's really important that I get those links removed soon.
 
To comply with certain DMCA's, I have to mass remove links from my community. Censoring doesn't help in this case as it only censors the domain and the censor can be replaced with the domain name to reach the content.

These are domains, and all links from these domains need to be removed.

So for example, I have
https://xenforo.com/community/threads/post-content-find-replace.6548/
https://xenforo.com/community/threads/post-content-find-replace.6548/page-63

These two links in different threads of my site,

I want to target [can be http/https]xenforo.com/<anything after this> and replace it with <LINK REMOVED>

What would be the expression for this?
Im having the same problem. I need to remove many pictures linked to a specific domain.
any help please?
 
If you used the vbulletin addon from the downloadsii - downloads to threads.

You will have broken links in your resources, as this resource only does posts and not resources you can use the following MYSQL statement and it will work for those links pointing to threads.

Code:
UPDATE xf_resource_update SET message = replace(message, 'showthread.php?t=', 'index.php?threads/')

REMEMBER - backup your database before doing this!!!

I just replaced over 4000 dead links.

Mick
 
I would like to replace all old vbulletin attachment links from
Code:
[IMG]https://www.my-forum.com/forum/attachment.php?attachmentid=123
to:
Code:
[IMG]https://www.my-forum.com/attachments/123

I found a similar replacement in this thread but for an URL that does not have a - sign between 'my' and 'forum'.
Is this the correct approach?

Quick find:
Code:
[IMG]https://www.my-forum.com/forum/attachment.php?attachmentid
Regular expression:
Code:
#(\[img]https://www\.my\-forum\.com)/forum/attachment\.php\?attachmentid=([0-9]+)&d=([0-9]+)(\[/img])#siu
Replacement String:
Code:
\1/attachments/\2/\4
 
can this addon perform Regex to posts which are submitted, before saving them?

Any other addon to do this?
It could be used on multiple things : - converting Amazon etc affiliate links, spam management, etc
I know multiple regex could hurt performance, but it would add great functionality?
 
Here is one I am struggling with. For reasons that aren't very clear to me, during our migration, a lot of carriage returns and/or newlines doubled, so now where there should be one blank line, there are two. Is there a way to find these returns (when there are more than one) and replace them with a single return?
 
More on the carriage return issue:

I have a lot of old quotes that look like this:
Code:
[quote]
[B][I]DarthVader1 wrote:[/I][/B]

I want them to look like this:

Code:
[QUOTE=DarthVader1]

Because it is two lines, I can't find a way to make regex pick it up. Thoughts?
 
Following up on the last line... I am getting close... but still not quite there:

Code:
#\[quote]\n\[B]\[I]([^\s]+)([^\[]+)\[\/I]\[\/B]#siu

It is still the \n \r issue that is getting me.
 
Hi can anyone help me with this one?

Code:
Code:
i want to replace: "[IMG]http://:D[/IMG]" with just ":D"

on the tool i can't see to get it right:

Quick Find: [URL]http://:D[/URL]

Regular expression: #\[IMG\]http:\/\/:D\[\/IMG\]#siU

Replacement String: :D

it just doesn't find anything, I've tried a few combinations and i can't get it to work! any thoughts? i've been using a similar regex to replace some old third party smilies fine
 
Top Bottom