Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: panoskouf on December 02, 2017, 08:27:36 AM

Title: how to block photobucket ?
Post by: panoskouf on December 02, 2017, 08:27:36 AM
1) I would like to block all Photobucket images from showing (other sites are ok)

2) Is there a predefined list of +18 rated sites where I can block somehow? (either make links not working or users not be able to post them)

3)How to hide all links from guests?

thanks in advance  :-*
Title: Re: how to block photobucket ?
Post by: vbgamer45 on December 02, 2017, 09:19:06 AM
1. Easy way would be to use the word censor.
2. No there isn't a list yet.
3. Try my mod here https://custom.simplemachines.org/mods/index.php?mod=342
Title: Re: how to block photobucket ?
Post by: panoskouf on December 02, 2017, 09:26:35 AM
Quote from: vbgamer45 on December 02, 2017, 09:19:06 AM
1. Easy way would be to use the word censor.
2. No there isn't a list yet.
3. Try my mod here https://custom.simplemachines.org/mods/index.php?mod=342

thank you :)
Title: Re: how to block photobucket ?
Post by: SusanTN on December 02, 2017, 02:12:31 PM
Edit the Subs.php from the sources directory

Find the function parse_bbc

Immediately after the global declarations  you will see


      // Don't waste cycles
        if ($message === '')
                return '';


After that add

        $message = preg_replace("/(\[img.*\].*photobucket.*)(\.jpg)(\[\/img.*\])/i", "", $message);


Problem solved. You can do the same thing for other image hosts.
Title: Re: how to block photobucket ?
Post by: vbgamer45 on December 02, 2017, 03:27:32 PM
Nice tip! I would maybe add some text to say photobucket not allowed so people do not get confused.
Title: Re: how to block photobucket ?
Post by: SusanTN on December 03, 2017, 04:12:26 AM
I ended up with

        $message = preg_replace("/(\[url=.*photobucket.*\])(\[\/url.*\])/i", "[Link Removed]", $message);
        $message = preg_replace("/(\[img.*\].*photobucket.*)(\.jpg)(\[\/img.*\])/i", "[Image Removed]", $message);


This is the message I posted to my members...

Quote from: Susan
All photobucket images have been removed from signatures and blocked from displaying in posts (even if you have paid them for the privilege). I will not tolerate spammy images extorting their customers, my poster to pay to display their images on my site.

Posts affected will state [Link Removed] for links, or [Image Removed] for images.

My recommendation is to find another image hosting provider.

Please take note: If your image host displays a large image advertisement when a image is linked to my site, or even when simply not found, they risk all images from that hosting provider being removed or blocked from my site as well.

I am looking at you tinypic...

I then sent photobucket a email message letting them know of my action and my post to you all so you could do the same...
Title: Re: how to block photobucket ?
Post by: vbgamer45 on December 03, 2017, 08:44:57 AM
I like it! Yeah caused issues for my users as well they used  photobucket to host many images. Then they decieded to charge an extremely high fee if you want to place them on third party sites.
Title: Re: how to block photobucket ?
Post by: showngo on December 03, 2017, 10:39:33 PM
Tagged to find later.


GREAT i formation,  im blocking the ransom site too.
Title: Re: how to block photobucket ?
Post by: panoskouf on December 04, 2017, 03:09:33 PM
You guys rock, keep up the good work  ;)