MyBB Community Forums

Full Version: How to enable word filter inside bbcode?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
It seems word filter does not work inside bbcode. is there anyway we can enable it inside bbcode?
What filters have you got set up (in terms of how the replacements are configured) and what bbcode are you using? I tried using just the [b] tag here and it worked as expected: https://community.mybb.com/thread-233314.html
this is what i am trying to do. basically replace test.com/abc.jpg to abc.com/abc.jpg
input
[img]https://test.com/abc.jpg[/img]

output
[img]https://abc.com/abc.jpg[/img]
Word filter is not applied to URL in IMG tag.
This can be achieved by changing the PHP hard code in class_parser.php: function mycode_parse_img()
You need to add the following method: "parse_badwords($url);"

[ETS]
If it's a definitive changement, it's better to run a SQL query
update mybb_posts set message=replace(message, 'https://test.com', 'https://abc.com')
Maybe you can make this with a custom MyCode instead, but consider @Crazycat's comment.
wordpress jetpack photon has free cdn for images. i was wondering if i could make all bbcode image like this

https://i2.wp.com/community.mybb.com/upl..._25096.jpg

here is more info
https://jetpack.com/support/site-accelerator/
Ok, I understand.
selfishly, I would say that using the CDN is only interresting for the pictures on your own server.

Peharps can you try to add a MyCode:
Regular expression
https://your.forum.url/(.+)\.(jpg|jpeg|gif|png)
Replacement
https://i2.wp.com/your.forum.url/$1.$2
(set it at position 1 in MyCode order)
This will only work for post contents, if you want to use CDN for all your pictures, you'll have to use a short plugin to replace the urls on the fly.
thank you so much, exactly that's what i was looking for.

(2021-08-18, 10:51 AM)Crazycat Wrote: [ -> ]Ok, I understand.
selfishly, I would say that using the CDN is only interresting for the pictures on your own server.

Peharps can you try to add a MyCode:
Regular expression
https://your.forum.url/(.+)\.(jpg|jpeg|gif|png)
Replacement
https://i2.wp.com/your.forum.url/$1.$2
(set it at position 1 in MyCode order)
This will only work for post contents, if you want to use CDN for all your pictures, you'll have to use a short plugin to replace the urls on the fly.
i am not good with regex. i tried to make something
https://regex101.com/r/8aFecr/1
can you please tell where am i doing it wrong?

https://i.imgur.com/lT2txmD.png

however thread output not adding the correct url which i am trying to get.
i getting strange problem. this link is working only for first [img] bbcode but if there is second [img] bbcode in same post, for second bbcode image link is not changing.
Pages: 1 2