News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Torture Trolls Mod

Started by MrMike, March 14, 2012, 02:18:56 PM

Previous topic - Next topic

MrMike

This isn't so much an actual mod as a bit of code to help frustrate "difficult" users or trolls and make them go away. Yes, I know there is an actual mod very similar to this but I didn't want to install it for a couple of reasons, so I wrote this tiny bit of code for my own use. I'm sharing it here in the hopes that someone else may find it useful. :)

I had a couple of extremely annoying trolls on one of my boards...banning them just resulted in them popping up with new IPs and usernames. So rather than muck about playing Whack-A-Mole with them, I decided to ruin their lives (at least when it came to using my forum). lol

If the user's ID is in the $bad_users list then the user is randomly tortured with a variety of annoying problems. Sometimes the board just seems really slow, sometimes they get a page full of random characters, sometimes they end up on the search page or the logout page, etc etc. It's been very effective at making life a living hell for the selected users. After a while they get enormously frustrated and slink off to troll someone else's site. :)

This code snippet goes at the top of the theme's 'index.template.php' page, right after all the SMF license and info block. You could make this an include file if you want to include it in multiple themes, and it's easily modified to add extra annoyances or other actions. Enjoy! :)

// list of users to be tortured
$bad_users = array(2209,2225,1033);

if( in_array($context['user']['id'], $bad_users) ){

    $random_chance = rand(1,100);
   
    // adjust the '25' to increase/decrease the "problem" occurrence rate
    if($random_chance > 25){
   
        $random_action = rand(1,8);

        /* // torture user methods
        1) 10 sec delay
        2) 20 sec delay
        3) 45 sec delay
        4) page full of garbage chars (I love this one!)
        5) send to random page
        6) send to search page
        7) send to logout page
        8) show database error message
        */

        if($random_action == "1"){sleep(10);}
        if($random_action == "2"){sleep(15);}
        if($random_action == "3"){sleep(30);}
       
        if($random_action == "4"){
            sleep(1);
            for($i=1; $i<10000; $i++){
                // use chars 32 ~ 254
                $rand_char = chr(round(rand(32, 254)));
                print $rand_char;
            }
            exit;
        }

        if($random_action == "5"){
            $random_page = round(rand(1, 1000));
            header("Location: /forum/index.php?topic=$random_page");
            exit;
        }

        if($random_action == "6"){
            header("Location: /forum/index.php?action=search");
            exit;
        }

        if($random_action == "7"){
            header("Location: /forum/index.php?action=logout");
            exit;
        }

        if($random_action == "8"){
            print "<html><body bgcolor=#ffffaa>Database over capacity - please wait a few moments and try again.</body></html>";
            exit;
        }
   
    }
}


kat

Mike... I like your style. ;)

stevej

I have to vouch for the awesomeness of this. It drives people crazy.

margarett

Very nice :)

Just a tip, use redirectexit instead of header("Location..... as that can be bypassed.
And for the 8, you can use SMF's fatal error. That can maybe give it a more "legitimate" look ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Arantor

So what exactly is wrong with the Annoy Users mod I wrote?

Advertisement: