[CMS Add-On] Wordfilter4Homepage

Results 1 to 7 of 7
  1. #1
    [CMS Add-On] Wordfilter4Homepage[CMS Add-On] Wordfilter4Homepage pel is offline
    MemberRank
    Jan 2012 Join Date
    Munich, GermanyLocation
    384Posts

    big grin [CMS Add-On] Wordfilter4Homepage

    Hi Guys.

    Today I coded a wordfilter 4 your Homepage ;DDDDD *swag-o-mat over 9000*

    Code: http://pastebin.com/qE2hwWxd
    Demo: http://84.200.10.90/wordfilter.php
    Screen: http://puu.sh/bxCIV/d6b3967349.png
    Or:
    PHP Code:
    <?php
        error_reporting
    (E_ALL);
        
    ini_set('display_errors'1);
        class 
    Wordfilter {
            
            private 
    $hotels = array(
                
    'habbo',
                
    'bobbaz',
                
    'jabbu',
                
    'jebbu',
                
    'jabbo',
                
    'fobba',
                
    'kuggo',
                
    'yebbo',
                
    'huggo',
                
    'holows',
                
    'ficken',
                
    'penis',
                
    'ibabbo',
                
    'livehotel',
                
    'cabbo',
                
    'hubbu',
                
    'hubbo',
                
    'hobbu',
                
    'hobbo',
                
    'hobba',
                
    'wubbu',
                
    'titanhotel',
                
    'hubba',
                
    'retrohotelcc',
                
    'habbor',
                
    'xebbo',
                
    'kibbu',
                
    'rabbo',
                
    'cybersex',
                
    'sperma',
                
    'kibbo',
                
    'vubba',
                
    'hebbo',
                
    'lemonhotel'
            
    );
            private 
    $removeKeys = array(
                
    '+',
                
    ' ',
                
    '|',
                
    'ȶ',
                
    '/',
                
    '\'',
                
    '"',
                
    '*',
                
    '~',
                
    '\\',
                
    '.',
                
    '-',
                
    ';',
                
    '<',
                
    '>',
                
    '_',
                
    '$',
                
    '#',
                
    '¦',
                
    '´',
                
    '`',
                
    '^',
                
    '}',
                
    '{',
                
    ']',
                
    '[',
                
    ',',
                
    '!',
                
    '$',
                
    'bz',
                
    'mn',
                
    'li',
                
    'st'
            
    );
            private 
    $utfKeywords = array(
                
    'û' => 'u',
                
    'ú' => 'u',
                
    'ù' => 'u',
                
    'â' => 'a',
                
    'á' => 'a',
                
    'à' => 'a',
                
    '@' => 'a',
                
    'ô' => 'o',
                
    'ó' => 'o',
                
    'ò' => 'o',
                
    'ê' => 'e',
                
    'é' => 'e',
                
    'è' => 'e',
                
    '4' => 'a',
                
    '0' => 'o',
                
    '$' => 's',
                
    '€' => 'e',
                
    '3' => 'e',
                
    'â' => 'a',
                
    'é' => 'e'
            
    ); 

            public function 
    addUtf($utf$norm) {
                
    $this->utfKeywords[$utf] = $norm;
            }
            
            public function 
    addRemoveKey($key) {
                
    $this->removeKeys[] = $key;
            }
            
            public function 
    addHotel($hotel) {
                
    $this->hotels[] = $hotel;
            }
            
            public function 
    checkText($text) {
                
    $this->convertUtf();
                
    $text explode(' '$text);
                
    $final '';
                foreach(
    $text as $word) {
                    
    $filter str_ireplace($this->removeKeys'', (str_ireplace($this->toChange16$this->toChange8, (stripslashes(htmlentities($wordENT_COMPAT'utf-8'))))));
                    
    $this->convertHotels();
                    if(isset(
    $this->toHotels[strtolower($filter)])) {
                        
    $cWord '';
                        for(
    $i 0$i <= strlen($filter); ++$i) {
                            
    $cWord .= '*';
                        }
                        
                        
    $final .= $cWord ' ';
                    } else {
                        
    $final .= $filter ' ';
                    }
                }
                
                return 
    $final;
            }
            
            private function 
    convertUtf() {
                
    $this->toChange16 = array();
                
    $this->toChange8 = array();
                
                foreach(
    $this->utfKeywords as $_16 => $_8) {
                    
    $this->toChange16[] = $_16;
                    
    $this->toChange8[] = $_8;
                }
            }
            
            public function 
    convertHotels() {
                
    $this->toHotels = array();
                
                foreach(
    $this->hotels as $hotel) {
                    
    $this->toHotels[$hotel] = $hotel;
                }
            }
            
            public function 
    isSuspiciousWord($word) {
                
    $this->convertUtf();
                
    $this->convertHotels();
                
                
    $filter str_ireplace($this->removeKeys'', (str_ireplace($this->toChange16$this->toChange8, (stripslashes(htmlentities($wordENT_COMPAT'utf-8'))))));
                
                return (isset(
    $this->toHotels[strtolower($filter)]));
            }
            
            public function 
    getHotelname($hotel) {
                
    $this->convertUtf();
                
    $this->convertHotels();
                
                
    $filter str_ireplace($this->removeKeys'', (str_ireplace($this->toChange16$this->toChange8, (stripslashes(htmlentities($hotelENT_COMPAT'utf-8'))))));
                
                return (isset(
    $this->toHotels[strtolower($filter)])) ? $this->toHotels[strtolower($filter)] : false;
            }
        }
        
        
    $wordfilter = new Wordfilter();
        
        if(isset(
    $_POST['check']) && (!empty($_POST['check']))) {
            
    $text explode(' '$_POST['check']);
            foreach(
    $text as $word) {
                if(
    $wordfilter->isSuspiciousWord($word)) {
                    echo 
    '<span style="color: red; font-weight: bold">'.$word.'('.$wordfilter->getHotelname($word).')</span> ';
                } else {
                    echo 
    $word ' ';
                }
            }
        }
    ?>
    <form method="post">
        <input type="text" name="check"><input type="submit">
    </form>
    Have a nice *day*, dudes!

    iExit


  2. #2
    Valued Member GrateZ4 is offline
    MemberRank
    Jul 2014 Join Date
    145Posts

    Re: [CMS Add-On] Wordfilter4Homepage

    I dont get what it's for?

  3. #3
    G'nome sayin' Exonize is offline
    MemberRank
    May 2011 Join Date
    Czech RepublicLocation
    517Posts

    Re: [CMS Add-On] Wordfilter4Homepage

    What do you mean by "Homepage", Habbo Homes or the site generally?

  4. #4
    Alpha Member Emily is offline
    MemberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: [CMS Add-On] Wordfilter4Homepage

    Maybe this could be used for motto changing? ;-)
    But other than that, I don't see the use of this code now.

  5. #5
    [CMS Add-On] Wordfilter4Homepage[CMS Add-On] Wordfilter4Homepage pel is offline
    MemberRank
    Jan 2012 Join Date
    Munich, GermanyLocation
    384Posts

    Re: [CMS Add-On] Wordfilter4Homepage

    Guys.. its a Wordfilter (like ingame) for the Homepage (outgame) and it will filtee 90% of all

  6. #6
    Account Upgraded | Title Enabled! PR0 is offline
    MemberRank
    Mar 2007 Join Date
    1,207Posts

    Re: [CMS Add-On] Wordfilter4Homepage

    Hey iExit! Thanks so much for the release! Good to see you're back developing PHP for retros heh.

    Does this add words to your word filter table so that they're filtered out?

    What would be the outcome of using this?


    P.S. - ReCMS has always been my favourite CMS. I've been meaning to translate it however I can never find a copy of it that works for me and always have troubles setting it up for some reason. I get white screens, etc etc.

    Do you have a copy of it that you could share with me hopefully?

    It would be very much so appreciated. Thanks :)

  7. #7
    [CMS Add-On] Wordfilter4Homepage[CMS Add-On] Wordfilter4Homepage pel is offline
    MemberRank
    Jan 2012 Join Date
    Munich, GermanyLocation
    384Posts

    Re: [CMS Add-On] Wordfilter4Homepage

    It checks words - the demo will show, what it could detect.
    So we can do: http://puu.sh/bynRy/86c44f697e.png
    Result: http://puu.sh/bynS1/fea2386b77.png

    So its a Wordfilter like Ingame - but for the CMS (outgame)



Advertisement