Resource icon

Post Content Find / Replace 1.0.0

No permission to download
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
 
actually that does work the issues is it doesn't find the original string... which is strange, neither can i find it with a SQL query
 
From a previous import I have a lot of posts with the following code in it:
Code:
<!--
var SymRealOnLoad;
var SymReal;

Sym()
{
window.open = SymWinOpen;
if(SymReal != null)
SymReal();
}

SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymReal = window.;
window. = Sym;
}

SymRealOnLoad = window.onload;
window.onload = SymOnLoad;

//-->


<!--
var SymRealOnLoad;
var SymReal;

Sym()
{
window.open = SymWinOpen;
if(SymReal != null)
SymReal();
}

SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymReal = window.;
window. = Sym;
}

SymRealOnLoad = window.onload;
window.onload = SymOnLoad;

//-->
Can I use this addon to remove it? Does anyone have a clue how?
 
I used this to convert a whole bunch of vBulletin youtube tags to XF media tags.

I think you can do it with this regex:

/\[code\][\s\S]*var SymRealOnLoad;[\s\S]*?\[\/code\]/i

provided "var SymRealOnLoad;"isn't in any other code block you don't want removed.

I'm pretty rusty at regular expressions. Maybe someone else could do better

Whatever you do PLEASE BACK-UP YOUR DATABASE BEFORE YOU START!
 
Last edited:
Has anyone here configured or modified this add-on to run on a schedule using Xenforo crons?
For example, so I can replace a string once every 24 hours for anyone posting new messages?
 
Back
Top Bottom