[Refferal System] RevCMS refferal system [Habbo theme]

Page 1 of 2 12 LastLast
Results 1 to 25 of 31
  1. #1
    Account Upgraded | Title Enabled! JaydenC is offline
    MemberRank
    Feb 2012 Join Date
    993Posts

    [Refferal System] RevCMS refferal system [Habbo theme]

    Meh, got bored and made this for a friend.

    Screenshot
    Spoiler:





    To set it up follow this.

    run this SQL first
    Code:
    ALTER TABLE  `users` ADD  `ref` VARCHAR( 255 ) NOT NULL
    open class.template.php in /app/

    search for this
    PHP Code:
    $this->setParams('ip_last'$users->getInfo($_SESSION['user']['id'], 'ip_last')); 
    add this under

    PHP Code:
    $this->setParams('refferal'$users->getInfo($_SESSION['user']['id'], 'ref')); 
    search for this in interface.users.php in /app/interface/

    PHP Code:
    public function nameTaken($username); 
    add this under

    PHP Code:
    public function ref($post); 
    replace your whole class.users.php in /app/ with this

    Spoiler:

    PHP Code:
    <?php

    namespace Revolution;
    if(!
    defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }
    class 
    users implements iUsers
    {
        
        
    /*-------------------------------Authenticate-------------------------------------*/ 
        
        
    final public function isLogged()
        {
            if(isset(
    $_SESSION['user']['id']))
            {
                return 
    true;
            }
            
            return 
    false;
        }
        
        
    /*-------------------------------Checking of submitted data-------------------------------------*/ 
        
        
    final public function validName($username)     
        {
            if(
    strlen($username) <= 25 && ctype_alnum($username))         
             {             
                 return 
    true;         
             }                  
             
             return 
    false;     
        }          
             
        final public function 
    validEmail($email)     
        {         
            return 
    preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i"$email);     
        }          
        
        final public function 
    validSecKey($seckey)
        {
            if(
    is_numeric($seckey) && strlen($seckey) == 4)
            {
                return 
    true;
            }
            
            return 
    false;
        }
        
        final public function 
    nameTaken($username)     
        {         
             global 
    $engine;         
             
            if(
    $engine->num_rows("SELECT * FROM users WHERE username = '" $username "' LIMIT 1") > 0)
            {
                return 
    true;
            }     
            
            return 
    false;
        } 
        
        final public function 
    emailTaken($email)
        {
            global 
    $engine;
            
            if(
    $engine->num_rows("SELECT * FROM users WHERE mail = '" $email "' LIMIT 1") > 0)
            {
                return 
    true;
            }
            
            return 
    false;
        }
            
        final public function 
    userValidation($username$password)
        {         
            global 
    $engine
            if(
    $engine->num_rows("SELECT * FROM users WHERE username = '" $username "' AND password = '" $password "' LIMIT 1") > 0)
            {
                return 
    true;
            }     
             
            return 
    false;
        }          
        
        
    /*-------------------------------Stuff related to bans-------------------------------------*/ 
        
        
    final public function isBanned($value)
        {
            global 
    $engine;
            if(
    $engine->num_rows("SELECT * FROM bans WHERE value = '" $value "' LIMIT 1") > 0)
            {
                return 
    true;
            }
                
            return 
    false;
        }
        
        final public function 
    getReason($value)
        {
            global 
    $engine;
            return 
    $engine->result("SELECT reason FROM bans WHERE value = '" $value "' LIMIT 1");
        }
        
        final public function 
    hasClones($ip)
        {
            global 
    $engine;
            if(
    $engine->num_rows("SELECT * FROM users WHERE ip_reg = '" $_SERVER['REMOTE_ADDR'] . "'") == 1)
            {
                return 
    true;
            }
            
            return 
    false;
        }
        
        
    /*-------------------------------Login or Register user-------------------------------------*/ 
        
        
    final public function register()
        {
            global 
    $core$template$_CONFIG;
            
            if(isset(
    $_POST['register']))
            {
                unset(
    $template->form->error);
                
                
    $template->form->setData();
                    
                if(
    $this->validName($template->form->reg_username))
                {
                    if(!
    $this->nameTaken($template->form->reg_username))
                    {
                        if(
    $this->validEmail($template->form->reg_email))
                        {
                            if(!
    $this->emailTaken($template->form->reg_email))
                            {
                                if(
    strlen($template->form->reg_password) > 6)
                                {
                                    if(
    $template->form->reg_password == $template->form->reg_rep_password)
                                    {
                                        if(isset(
    $template->form->reg_seckey))
                                        {
                                            if(
    $this->validSecKey($template->form->reg_seckey))
                                            {
                                                
    //Continue
                                            
    }
                                            else
                                            {
                                                
    $template->form->error 'Secret key must only have 4 numbers';
                                                return;
                                            }
                                        }
                                        if(
    $this->isBanned($_SERVER['REMOTE_ADDR']) == false)
                                        {
                                            if(!
    $this->hasClones($_SERVER['REMOTE_ADDR']))
                                            {
                                                if(!isset(
    $template->form->reg_gender)) { $template->form->reg_gender 'M'; }
                                                if(!isset(
    $template->form->reg_figure)) { $template->form->reg_figure $_CONFIG['hotel']['figure']; }
                                            
                                                
    $this->addUser($template->form->reg_username$core->hashed($template->form->reg_password), $template->form->reg_email$_CONFIG['hotel']['motto'], $_CONFIG['hotel']['credits'], $_CONFIG['hotel']['pixels'], 1$template->form->reg_figure$template->form->reg_gender$core->hashed($template->form->reg_key));
                                
                                                
    $this->turnOn($template->form->reg_username);
                                        
                                                
    header('Location: ' $_CONFIG['hotel']['url'] . '/me');
                                                exit;
                                            }
                                            else
                                            {
                                                
    $template->form->error 'Sorry, but you cannot register twice';
                                            }
                                        }
                                        else
                                        {
                                            
    $template->form->error 'Sorry, it appears you are IP banned.<br />';
                                            
    $template->form->error .= 'Reason: ' $this->getReason($_SERVER['REMOTE_ADDR']);
                                            return;
                                        }
                                    }
                                    else    
                                    {
                                        
    $template->form->error 'Password does not match repeated password';
                                        return;
                                    }

                                }
                                else
                                {
                                    
    $template->form->error 'Password must have more than 6 characters';
                                    return;
                                }
                            }
                            else
                            {
                                
    $template->form->error 'Email: <b>' $template->form->reg_email '</b> is already registered';
                                return;
                            }
                        }
                        else
                        {
                            
    $template->form->error 'Email is not valid';
                            return;
                        }
                    }
                    else
                    {
                        
    $template->form->error 'Username is already registered';
                        return;
                    }
                }
                else
                {
                    
    $template->form->error 'Username is invalid';
                    return;
                }
            }
        }    
        
        final public function 
    login()
        {
            global 
    $template$_CONFIG$core;
            
            if(isset(
    $_POST['login']))
            {
                
    $template->form->setData();
                unset(
    $template->form->error);
                
                if(
    $this->nameTaken($template->form->log_username))
                {
                    if(
    $this->isBanned($template->form->log_username) == false || $this->isBanned($_SERVER['REMOTE_ADDR']) == false)
                    {
                        if(
    $this->userValidation($template->form->log_username$core->hashed($template->form->log_password)))
                        {
                            
    $this->turnOn($template->form->log_username);
                            
    $this->updateUser($_SESSION['user']['id'], 'ip_last'$_SERVER['REMOTE_ADDR']);
                            
    $template->form->unsetData();
                            
    header('Location: ' $_CONFIG['hotel']['url'] . '/me');
                            exit;
                        }
                        else
                        {
                            
    $template->form->error 'Details do not match';
                            return;
                        }
                    }
                    else
                    {
                        
    $template->form->error 'Sorry, it appears this user is banned<br />';
                        
    $template->form->error .= 'Reason: ' $this->getReason($template->form->log_username);
                        return;
                    }
                }
                else
                {
                    
    $template->form->error 'Username does not exist';
                    return;
                }
            }
        }
         final public function 
    ref($post){
            if(!
    $this->nameTaken($post)){
            echo
    'The user you reffered does not exist';
            }else{
                     global 
    $engine;
            
    $this->addUser($template->form->reg_username$core->hashed($template->form->reg_password), $template->form->reg_email$_CONFIG['hotel']['motto'], $_CONFIG['hotel']['credits'], $_CONFIG['hotel']['pixels'], 1$template->form->reg_figure$template->form->reg_gender$core->hashed($template->form->reg_key));
            
    $engine->query("UPDATE users SET credits=(`credits`+1000) WHERE username='".$post."'");
            
    $engine->query("UPDATE users SET ref=(`ref`+1) WHERE username='".$post."'");
            }
            }
        final public function 
    loginHK()
        {
            global 
    $template$_CONFIG$core;
            
            if(isset(
    $_POST['login']))
            {    
                
    $template->form->setData();
                unset(
    $template->form->error);
                
                if(isset(
    $template->form->username) && isset($template->form->password))
                {
                    if(
    $this->nameTaken($template->form->username)) 
                    {     
                        if(
    $this->userValidation($template->form->username$core->hashed($template->form->password)))
                        {
                            if((
    $this->getInfo($_SESSION['user']['id'], 'rank')) >= 4)
                            {
                                
    $_SESSION["in_hk"] = true;
                                
    header("Location:".$_CONFIG['hotel']['url']."/ase/dash");
                                exit;
                            }
                            else
                            {
                                
    $template->form->error 'Incorrect access level.';
                                return;
                            }
                        }
                        else
                        {
                            
    $template->form->error 'Incorrect password.';
                            return;
                        }        
                    }
                    else
                    {
                        
    $template->form->error 'User does not exist.';
                        return;
                    }
                }
        
                
    $template->form->unsetData();
            }
        }    
        
        final public function 
    help()
        {
            global 
    $template$_CONFIG;
            
    $template->form->setData();
            
            if(isset(
    $template->form->help))
            {
                
    $to $_CONFIG['hotel']['email'];
                 
    $subject "Help from RevCMS user - " $this->getInfo($_SESSION['user']['id'], 'username');
                 
    $body $template->form->question;
                     
                 if (
    mail($to$subject$body))
                 {
                     
    $template->form->error 'Message successfully sent! We will answer you shortly!';
                 } 
                 else 
                 {
                       
    $template->form->error 'Message delivery failed.';
                 }
            }
        }

        
    /*-------------------------------Account settings-------------------------------------*/ 
        
        
    final public function updateAccount()
        {
            global 
    $template$_CONFIG$core$engine;
            
            if(isset(
    $_POST['account']))
            {
            
                if(isset(
    $_POST['acc_motto']) && strlen($_POST['acc_motto']) < 30 && $_POST['acc_motto'] != $this->getInfo($_SESSION['user']['id'], 'motto'))
                {
                    
    $this->updateUser($_SESSION['user']['id'], 'motto'$engine->secure($_POST['acc_motto']));
                    
    header('Location: '.$_CONFIG['hotel']['url'].'/account');
                    exit;
                }
                else
                {
                    
    $template->form->error 'Motto is invalid.';
                }
                
                if(isset(
    $_POST['acc_email']) && $_POST['acc_email'] != $this->getInfo($_SESSION['user']['id'], 'mail'))
                {
                    if(
    $this->validEmail($_POST['acc_email']))
                    {
                        
    $this->updateUser($_SESSION['user']['id'], 'mail'$engine->secure($_POST['acc_email']));
                        
    header('Location: '.$_CONFIG['hotel']['url'].'/account');
                        exit;
                    }
                    else
                    {
                        
    $template->form->error 'Email is not valid';
                        return;
                    }
                }
                
                if(!empty(
    $_POST['acc_old_password']) && !empty($_POST['acc_new_password']))
                {
                    if(
    $this->userValidation($this->getInfo($_SESSION['user']['id'], 'username'), $core->hashed($_POST['acc_old_password'])))
                    {
                        if(
    strlen($_POST['acc_new_password']) >= 8)
                        {
                            
    $this->updateUser($_SESSION['user']['id'], 'password'$core->hashed($_POST['acc_new_password']));
                            
    header('Location: '.$_CONFIG['hotel']['url'].'/me');
                            exit;
                        }
                        else
                        {
                            
    $template->form->error 'New password is too short';
                            return;
                        }
                    }
                    else
                    {
                        
    $template->form->error 'Current password is wrong';
                        return;
                    }
                }
            }        
        }
            
            
        final public function 
    turnOn($k)
        {    
            
    $j $this->getID($k);
            
    $this->createSSO($j);
            
    $_SESSION['user']['id'] = $j;    
            
    $this->cacheUser($j);    
            unset(
    $j);
        }
        
        
    /*-------------------------------Loggin forgotten-------------------------------------*/     
        
        
    final public function forgotten()
        {
            global 
    $template$_CONFIG$core;
            
            if(isset(
    $_POST['forgot']))
            {
            
                
    $template->form->setData();
                unset(
    $template->form->error);
                
                if(
    $this->nameTaken($template->form->for_username))
                {
                    if(
    strlen($template->form->for_password) > 6)
                    {
                        if(
    $this->getInfo($this->getID($template->form->for_username), 'seckey') == $core->hashed($template->form->for_key))
                        {
                            
    $this->updateUser($this->getID($template->form->for_username), 'password'$core->hashed($template->form->for_password));
                            
    $template->form->error 'Account recovered! Go <b><a href="index">here</a></b> to login!';
                            return;
                        }
                        else
                        {
                            
    $template->form->error 'Secret key is incorrect';
                            return;
                        }
                    }
                    else
                    {
                        
    $template->form->error 'Password must have more than 6 characters.';
                        return;
                    }
                }
                else
                {
                    
    $template->form->error 'Username does not exist';
                    return;
                }
            }
        }
        
        
    /*-------------------------------Create SSO auth_ticket-------------------------------------*/ 
        
        
    final public function createSSO($k)     
        {          
            
    $sessionKey 'RevCMS-'.rand(9,999).'/'.substr(sha1(time()).'/'.rand(9,9999999).'/'.rand(9,9999999).'/'.rand(9,9999999),0,33);
            
            
    $this->updateUser($k'auth_ticket'$sessionKey);
            
            unset(
    $sessionKey);
        }      
            
        
    /*-------------------------------Adding/Updating/Deleting users-------------------------------------*/ 
        
         
    final public function addUser($username$password$email$motto$credits$pixels$rank$figure$gender$seckey)        
            {              
                                                   
                    if(
    $_POST['ref']){
                    
    $ref $_POST['ref'];
            
    $this->ref($ref);
                                             }else{
                                             
                                             global 
    $engine;
                
    $sessionKey 'RevCMS-'.rand(9,999).'/'.substr(sha1(time()).'/'.rand(9,9999999).'/'.rand(9,9999999).'/'.rand(9,9999999),0,33);
                    
    $engine->query("INSERT INTO users (username, password, mail, motto, credits, activity_points, rank, look, gender, seckey, ip_last, ip_reg, account_created, last_online, auth_ticket) VALUES('" $username "', '" $password "', '" $email "', '" $motto "', '" $credits "', '" $pixels "', '" $rank "', '" $figure "', '" $gender "', '" $seckey "', '" $_SERVER['REMOTE_ADDR'] . "', '" $_SERVER['REMOTE_ADDR'] . "', '" time() . "', '" time() . "', '" $sessionKey "')");        
                    
    $user_id $this->getID($username);
                    
    $engine->query("INSERT INTO user_info (user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('"$user_id ."', '0', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '0', '0')");
                    unset(
    $sessionKey);    
                                             }
            }                               
             
        final public function 
    deleteUser($k)     
        {         
            global 
    $engine;                  
             
    $engine->query("DELETE FROM users WHERE id = '" $k "' LIMIT 1");         
             
    $engine->query("DELETE FROM items WHERE userid = '" $k "' LIMIT 1");         
            
    $engine->query("DELETE FROM rooms WHERE ownerid = '" $k "' LIMIT 1");     
        }     
              
        final public function 
    updateUser($k$key$value)     
        {         
             global 
    $engine;                  
             
    $engine->query("UPDATE users SET " $key " = '" $engine->secure($value) . "' WHERE id = '" $k "' LIMIT 1");
             
    $_SESSION['user'][$key] = $engine->secure($value);        
        } 
        
        
    /*-------------------------------Handling user information-------------------------------------*/      
        
        
    final public function cacheUser($k)
        {
            global 
    $engine;              
            
    $userInfo $engine->fetch_assoc("SELECT username, rank, motto, mail, credits, activity_points, look, auth_ticket, ip_last FROM users WHERE id = '" $k "' LIMIT 1");
            
            foreach(
    $userInfo as $key => $value)
            {
                
    $this->setInfo($key$value);
            }
        }    
        
        final public function 
    setInfo($key$value)
        {
            global 
    $engine;
            
    $_SESSION['user'][$key] = $engine->secure($value);
        }

        final public function 
    getInfo($k$key)
        {
            global 
    $engine;
            if(!isset(
    $_SESSION['user'][$key]))
            {
                
    $value $engine->result("SELECT $key FROM users WHERE id = '" $engine->secure($k) . "' LIMIT 1"); 
                if(
    $value != null)
                {            
                    
    $this->setInfo($key$value);
                }
            }
                
            return 
    $_SESSION['user'][$key];
        }
        
        
        
        
    /*-------------------------------Get user ID or Username-------------------------------------*/ 
        
        
    final public function getID($k)     
        {         
            global 
    $engine;         
            return 
    $engine->result("SELECT id FROM users WHERE username = '" $engine->secure($k) . "' LIMIT 1");     
        }         
        
        final public function 
    getUsername($k)
        {
            global 
    $engine;
            return 
    $this->getInfo($_SESSION['user']['id'], 'username');
        }
        
    }
    ?>


    open your quick register page

    search for this

    Code:
    <div class="field">
                    <label for="email-address">Email</label>
                    <input type="text" id="email" size="35" name="email" value="<?php echo $template->form->reg_email; ?>" class="text-field" maxlength="48">
                </div>
    add this under

    Code:
    <div class="field">
                    <label for="email-address">Refferer (Optional)</label>
                    <input type="text" id="email" size="35" name="ref" value="<?php echo $template->form->reg_email; ?>" class="text-field" maxlength="48">
                </div>
    then add this to your me page

    Spoiler:

    Code:
    <div id="column1" class="column">
    <div class="habblet-container ">               
    <div class="cb clearfix orange "><div class="bt"><div></div></div><div class="i1"><div class="i2"><div class="i3">
     
    <div class="rounded-container"><div style="background-color: rgb(255, 255, 255);"><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(249, 150, 85);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(249, 150, 85);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div></div><h2 class="title rounded-done">Referal</h2><div style="background-color: rgb(255, 255, 255);"><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(249, 150, 85);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(249, 150, 85);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div></div></div></div></div>
     
    <div class="box-content">
       
    <center>
    {username}, tell your friends to put your name in the refferal box when they register so you can get <B>1000</b> credits!</br>
    (This was coded by Jaydenn from RageZone)
    </center>
    <br>
    <div class="rounded-container"><div style="background-color: rgb(255, 255, 255);"><div style="margin: 0px 4px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 193, 107);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(244, 165, 40);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 151, 8);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div></div></div><div style="margin: 0px 2px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 192, 105);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 1);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(245, 175, 64);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(247, 192, 105);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 1);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(247, 193, 107);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(244, 165, 40);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(242, 151, 8);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div><div class="rounded-orange rounded-done"><center>
    You invited {refferal} users!
    </center></div><div style="background-color: rgb(255, 255, 255);"><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(242, 151, 8);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(244, 165, 40);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(247, 193, 107);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 1);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(247, 192, 105);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(245, 175, 64);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div><div style="margin: 0px 2px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 192, 105);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 1);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div></div><div style="margin: 0px 4px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 193, 107);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(244, 165, 40);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 151, 8);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div></div></div></div></div>
    </div>
     
     
    </div></div></div><div class="bb"><div></div></div></div>
    </div>
                    </div>


    credits; me for coding it, HabflareH for idea, and ImJoeyz hotels refferal box.

    Enjoy
    Last edited by JaydenC; 04-03-13 at 01:05 AM.


  2. #2
    Just out there.. Flare is offline
    MemberRank
    Jun 2012 Join Date
    269Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    :D, love it as im using it now !

  3. #3
    Valued Member Noman is offline
    MemberRank
    Sep 2011 Join Date
    United KingdomLocation
    137Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Awesome stuff, adding this onto my site now. Thanks. :D

  4. #4
    Account Upgraded | Title Enabled! JaydenC is offline
    MemberRank
    Feb 2012 Join Date
    993Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Quote Originally Posted by Noman View Post
    Awesome stuff, adding this onto my site now. Thanks. :D
    Glad you both enjoyed it ! ^^

    Plz let me know if you run into any problems.

    and for the record - i don't use revCMS ;)

  5. #5
    Account Upgraded | Title Enabled! iRetro™ is offline
    MemberRank
    Feb 2010 Join Date
    United KingdomLocation
    558Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    You..... are something else.

  6. #6
    Im Back! PythoneX12 is offline
    MemberRank
    Sep 2010 Join Date
    634Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Thanks but I got my own referral system :P this is nice though.

  7. #7
    Account Upgraded | Title Enabled! JaydenC is offline
    MemberRank
    Feb 2012 Join Date
    993Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Quote Originally Posted by ImJoeYz View Post
    You..... are something else.
    I certainly hope your are being nice ;):

    if not, still thanks! : D

  8. #8
    Zephyr Studios PRIZM is offline
    MemberRank
    Feb 2012 Join Date
    DenmarkLocation
    2,291Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Thanks dude! The little script that really makes a hotel bigger..

    Doesn't work for me when I make a new user and write my username as refferer.
    Does the script have some ip protection, so users only can refferer one time per ip?
    Last edited by PRIZM; 04-03-13 at 07:32 AM.

  9. #9
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,608Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    $engine->query("UPDATE users SET ref=(`ref`+1) WHERE username='".$post."'");
    Exploit?

  10. #10
    Account Upgraded | Title Enabled! JaydenC is offline
    MemberRank
    Feb 2012 Join Date
    993Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Quote Originally Posted by tdid View Post
    $engine->query("UPDATE users SET ref=(`ref`+1) WHERE username='".$post."'");
    Exploit?
    no...?

    $post = $username = $_SESSION['username'] with proper escapes etc. plz don't post if u don't know what your talking about

  11. #11
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,608Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Quote Originally Posted by jaydenn View Post
    no...?

    $post = $username = $_SESSION['username'] with proper escapes etc. plz don't post if u don't know what your talking about
    It is because RevCMS is ugly coded. I know what I'm talking about.

  12. #12
    Account Upgraded | Title Enabled! JaydenC is offline
    MemberRank
    Feb 2012 Join Date
    993Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Quote Originally Posted by tdid View Post
    It is because RevCMS is ugly coded. I know what I'm talking about.
    but there is no exploit...

  13. #13
    Account Upgraded | Title Enabled! rory129 is offline
    MemberRank
    May 2009 Join Date
    МанчестLocation
    233Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Quote Originally Posted by jaydenn View Post
    Meh, got bored and made this for a friend.

    Screenshot
    Spoiler:





    To set it up follow this.

    run this SQL first
    Code:
    ALTER TABLE  `users` ADD  `ref` VARCHAR( 255 ) NOT NULL
    open class.template.php in /app/

    search for this
    PHP Code:
    $this->setParams('ip_last'$users->getInfo($_SESSION['user']['id'], 'ip_last')); 
    add this under

    PHP Code:
    $this->setParams('refferal'$users->getInfo($_SESSION['user']['id'], 'ref')); 
    search for this in interface.users.php in /app/interface/

    PHP Code:
    public function nameTaken($username); 
    add this under

    PHP Code:
    public function ref($post); 
    replace your whole class.users.php in /app/ with this

    Spoiler:

    PHP Code:
    <?php

    namespace Revolution;
    if(!
    defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }
    class 
    users implements iUsers
    {
        
        
    /*-------------------------------Authenticate-------------------------------------*/ 
        
        
    final public function isLogged()
        {
            if(isset(
    $_SESSION['user']['id']))
            {
                return 
    true;
            }
            
            return 
    false;
        }
        
        
    /*-------------------------------Checking of submitted data-------------------------------------*/ 
        
        
    final public function validName($username)     
        {
            if(
    strlen($username) <= 25 && ctype_alnum($username))         
             {             
                 return 
    true;         
             }                  
             
             return 
    false;     
        }          
             
        final public function 
    validEmail($email)     
        {         
            return 
    preg_match("/^[a-z0-9_\.-]+@([a-z0-9]+([\-]+[a-z0-9]+)*\.)+[a-z]{2,7}$/i"$email);     
        }          
        
        final public function 
    validSecKey($seckey)
        {
            if(
    is_numeric($seckey) && strlen($seckey) == 4)
            {
                return 
    true;
            }
            
            return 
    false;
        }
        
        final public function 
    nameTaken($username)     
        {         
             global 
    $engine;         
             
            if(
    $engine->num_rows("SELECT * FROM users WHERE username = '" $username "' LIMIT 1") > 0)
            {
                return 
    true;
            }     
            
            return 
    false;
        } 
        
        final public function 
    emailTaken($email)
        {
            global 
    $engine;
            
            if(
    $engine->num_rows("SELECT * FROM users WHERE mail = '" $email "' LIMIT 1") > 0)
            {
                return 
    true;
            }
            
            return 
    false;
        }
            
        final public function 
    userValidation($username$password)
        {         
            global 
    $engine
            if(
    $engine->num_rows("SELECT * FROM users WHERE username = '" $username "' AND password = '" $password "' LIMIT 1") > 0)
            {
                return 
    true;
            }     
             
            return 
    false;
        }          
        
        
    /*-------------------------------Stuff related to bans-------------------------------------*/ 
        
        
    final public function isBanned($value)
        {
            global 
    $engine;
            if(
    $engine->num_rows("SELECT * FROM bans WHERE value = '" $value "' LIMIT 1") > 0)
            {
                return 
    true;
            }
                
            return 
    false;
        }
        
        final public function 
    getReason($value)
        {
            global 
    $engine;
            return 
    $engine->result("SELECT reason FROM bans WHERE value = '" $value "' LIMIT 1");
        }
        
        final public function 
    hasClones($ip)
        {
            global 
    $engine;
            if(
    $engine->num_rows("SELECT * FROM users WHERE ip_reg = '" $_SERVER['REMOTE_ADDR'] . "'") == 1)
            {
                return 
    true;
            }
            
            return 
    false;
        }
        
        
    /*-------------------------------Login or Register user-------------------------------------*/ 
        
        
    final public function register()
        {
            global 
    $core$template$_CONFIG;
            
            if(isset(
    $_POST['register']))
            {
                unset(
    $template->form->error);
                
                
    $template->form->setData();
                    
                if(
    $this->validName($template->form->reg_username))
                {
                    if(!
    $this->nameTaken($template->form->reg_username))
                    {
                        if(
    $this->validEmail($template->form->reg_email))
                        {
                            if(!
    $this->emailTaken($template->form->reg_email))
                            {
                                if(
    strlen($template->form->reg_password) > 6)
                                {
                                    if(
    $template->form->reg_password == $template->form->reg_rep_password)
                                    {
                                        if(isset(
    $template->form->reg_seckey))
                                        {
                                            if(
    $this->validSecKey($template->form->reg_seckey))
                                            {
                                                
    //Continue
                                            
    }
                                            else
                                            {
                                                
    $template->form->error 'Secret key must only have 4 numbers';
                                                return;
                                            }
                                        }
                                        if(
    $this->isBanned($_SERVER['REMOTE_ADDR']) == false)
                                        {
                                            if(!
    $this->hasClones($_SERVER['REMOTE_ADDR']))
                                            {
                                                if(!isset(
    $template->form->reg_gender)) { $template->form->reg_gender 'M'; }
                                                if(!isset(
    $template->form->reg_figure)) { $template->form->reg_figure $_CONFIG['hotel']['figure']; }
                                            
                                                
    $this->addUser($template->form->reg_username$core->hashed($template->form->reg_password), $template->form->reg_email$_CONFIG['hotel']['motto'], $_CONFIG['hotel']['credits'], $_CONFIG['hotel']['pixels'], 1$template->form->reg_figure$template->form->reg_gender$core->hashed($template->form->reg_key));
                                
                                                
    $this->turnOn($template->form->reg_username);
                                        
                                                
    header('Location: ' $_CONFIG['hotel']['url'] . '/me');
                                                exit;
                                            }
                                            else
                                            {
                                                
    $template->form->error 'Sorry, but you cannot register twice';
                                            }
                                        }
                                        else
                                        {
                                            
    $template->form->error 'Sorry, it appears you are IP banned.<br />';
                                            
    $template->form->error .= 'Reason: ' $this->getReason($_SERVER['REMOTE_ADDR']);
                                            return;
                                        }
                                    }
                                    else    
                                    {
                                        
    $template->form->error 'Password does not match repeated password';
                                        return;
                                    }

                                }
                                else
                                {
                                    
    $template->form->error 'Password must have more than 6 characters';
                                    return;
                                }
                            }
                            else
                            {
                                
    $template->form->error 'Email: <b>' $template->form->reg_email '</b> is already registered';
                                return;
                            }
                        }
                        else
                        {
                            
    $template->form->error 'Email is not valid';
                            return;
                        }
                    }
                    else
                    {
                        
    $template->form->error 'Username is already registered';
                        return;
                    }
                }
                else
                {
                    
    $template->form->error 'Username is invalid';
                    return;
                }
            }
        }    
        
        final public function 
    login()
        {
            global 
    $template$_CONFIG$core;
            
            if(isset(
    $_POST['login']))
            {
                
    $template->form->setData();
                unset(
    $template->form->error);
                
                if(
    $this->nameTaken($template->form->log_username))
                {
                    if(
    $this->isBanned($template->form->log_username) == false || $this->isBanned($_SERVER['REMOTE_ADDR']) == false)
                    {
                        if(
    $this->userValidation($template->form->log_username$core->hashed($template->form->log_password)))
                        {
                            
    $this->turnOn($template->form->log_username);
                            
    $this->updateUser($_SESSION['user']['id'], 'ip_last'$_SERVER['REMOTE_ADDR']);
                            
    $template->form->unsetData();
                            
    header('Location: ' $_CONFIG['hotel']['url'] . '/me');
                            exit;
                        }
                        else
                        {
                            
    $template->form->error 'Details do not match';
                            return;
                        }
                    }
                    else
                    {
                        
    $template->form->error 'Sorry, it appears this user is banned<br />';
                        
    $template->form->error .= 'Reason: ' $this->getReason($template->form->log_username);
                        return;
                    }
                }
                else
                {
                    
    $template->form->error 'Username does not exist';
                    return;
                }
            }
        }
         final public function 
    ref($post){
            if(!
    $this->nameTaken($post)){
            echo
    'The user you reffered does not exist';
            }else{
                     global 
    $engine;
            
    $this->addUser($template->form->reg_username$core->hashed($template->form->reg_password), $template->form->reg_email$_CONFIG['hotel']['motto'], $_CONFIG['hotel']['credits'], $_CONFIG['hotel']['pixels'], 1$template->form->reg_figure$template->form->reg_gender$core->hashed($template->form->reg_key));
            
    $engine->query("UPDATE users SET credits=(`credits`+1000) WHERE username='".$post."'");
            
    $engine->query("UPDATE users SET ref=(`ref`+1) WHERE username='".$post."'");
            }
            }
        final public function 
    loginHK()
        {
            global 
    $template$_CONFIG$core;
            
            if(isset(
    $_POST['login']))
            {    
                
    $template->form->setData();
                unset(
    $template->form->error);
                
                if(isset(
    $template->form->username) && isset($template->form->password))
                {
                    if(
    $this->nameTaken($template->form->username)) 
                    {     
                        if(
    $this->userValidation($template->form->username$core->hashed($template->form->password)))
                        {
                            if((
    $this->getInfo($_SESSION['user']['id'], 'rank')) >= 4)
                            {
                                
    $_SESSION["in_hk"] = true;
                                
    header("Location:".$_CONFIG['hotel']['url']."/ase/dash");
                                exit;
                            }
                            else
                            {
                                
    $template->form->error 'Incorrect access level.';
                                return;
                            }
                        }
                        else
                        {
                            
    $template->form->error 'Incorrect password.';
                            return;
                        }        
                    }
                    else
                    {
                        
    $template->form->error 'User does not exist.';
                        return;
                    }
                }
        
                
    $template->form->unsetData();
            }
        }    
        
        final public function 
    help()
        {
            global 
    $template$_CONFIG;
            
    $template->form->setData();
            
            if(isset(
    $template->form->help))
            {
                
    $to $_CONFIG['hotel']['email'];
                 
    $subject "Help from RevCMS user - " $this->getInfo($_SESSION['user']['id'], 'username');
                 
    $body $template->form->question;
                     
                 if (
    mail($to$subject$body))
                 {
                     
    $template->form->error 'Message successfully sent! We will answer you shortly!';
                 } 
                 else 
                 {
                       
    $template->form->error 'Message delivery failed.';
                 }
            }
        }

        
    /*-------------------------------Account settings-------------------------------------*/ 
        
        
    final public function updateAccount()
        {
            global 
    $template$_CONFIG$core$engine;
            
            if(isset(
    $_POST['account']))
            {
            
                if(isset(
    $_POST['acc_motto']) && strlen($_POST['acc_motto']) < 30 && $_POST['acc_motto'] != $this->getInfo($_SESSION['user']['id'], 'motto'))
                {
                    
    $this->updateUser($_SESSION['user']['id'], 'motto'$engine->secure($_POST['acc_motto']));
                    
    header('Location: '.$_CONFIG['hotel']['url'].'/account');
                    exit;
                }
                else
                {
                    
    $template->form->error 'Motto is invalid.';
                }
                
                if(isset(
    $_POST['acc_email']) && $_POST['acc_email'] != $this->getInfo($_SESSION['user']['id'], 'mail'))
                {
                    if(
    $this->validEmail($_POST['acc_email']))
                    {
                        
    $this->updateUser($_SESSION['user']['id'], 'mail'$engine->secure($_POST['acc_email']));
                        
    header('Location: '.$_CONFIG['hotel']['url'].'/account');
                        exit;
                    }
                    else
                    {
                        
    $template->form->error 'Email is not valid';
                        return;
                    }
                }
                
                if(!empty(
    $_POST['acc_old_password']) && !empty($_POST['acc_new_password']))
                {
                    if(
    $this->userValidation($this->getInfo($_SESSION['user']['id'], 'username'), $core->hashed($_POST['acc_old_password'])))
                    {
                        if(
    strlen($_POST['acc_new_password']) >= 8)
                        {
                            
    $this->updateUser($_SESSION['user']['id'], 'password'$core->hashed($_POST['acc_new_password']));
                            
    header('Location: '.$_CONFIG['hotel']['url'].'/me');
                            exit;
                        }
                        else
                        {
                            
    $template->form->error 'New password is too short';
                            return;
                        }
                    }
                    else
                    {
                        
    $template->form->error 'Current password is wrong';
                        return;
                    }
                }
            }        
        }
            
            
        final public function 
    turnOn($k)
        {    
            
    $j $this->getID($k);
            
    $this->createSSO($j);
            
    $_SESSION['user']['id'] = $j;    
            
    $this->cacheUser($j);    
            unset(
    $j);
        }
        
        
    /*-------------------------------Loggin forgotten-------------------------------------*/     
        
        
    final public function forgotten()
        {
            global 
    $template$_CONFIG$core;
            
            if(isset(
    $_POST['forgot']))
            {
            
                
    $template->form->setData();
                unset(
    $template->form->error);
                
                if(
    $this->nameTaken($template->form->for_username))
                {
                    if(
    strlen($template->form->for_password) > 6)
                    {
                        if(
    $this->getInfo($this->getID($template->form->for_username), 'seckey') == $core->hashed($template->form->for_key))
                        {
                            
    $this->updateUser($this->getID($template->form->for_username), 'password'$core->hashed($template->form->for_password));
                            
    $template->form->error 'Account recovered! Go <b><a href="index">here</a></b> to login!';
                            return;
                        }
                        else
                        {
                            
    $template->form->error 'Secret key is incorrect';
                            return;
                        }
                    }
                    else
                    {
                        
    $template->form->error 'Password must have more than 6 characters.';
                        return;
                    }
                }
                else
                {
                    
    $template->form->error 'Username does not exist';
                    return;
                }
            }
        }
        
        
    /*-------------------------------Create SSO auth_ticket-------------------------------------*/ 
        
        
    final public function createSSO($k)     
        {          
            
    $sessionKey 'RevCMS-'.rand(9,999).'/'.substr(sha1(time()).'/'.rand(9,9999999).'/'.rand(9,9999999).'/'.rand(9,9999999),0,33);
            
            
    $this->updateUser($k'auth_ticket'$sessionKey);
            
            unset(
    $sessionKey);
        }      
            
        
    /*-------------------------------Adding/Updating/Deleting users-------------------------------------*/ 
        
         
    final public function addUser($username$password$email$motto$credits$pixels$rank$figure$gender$seckey)        
            {              
                                                   
                    if(
    $_POST['ref']){
                    
    $ref $_POST['ref'];
            
    $this->ref($ref);
                                             }else{
                                             
                                             global 
    $engine;
                
    $sessionKey 'RevCMS-'.rand(9,999).'/'.substr(sha1(time()).'/'.rand(9,9999999).'/'.rand(9,9999999).'/'.rand(9,9999999),0,33);
                    
    $engine->query("INSERT INTO users (username, password, mail, motto, credits, activity_points, rank, look, gender, seckey, ip_last, ip_reg, account_created, last_online, auth_ticket) VALUES('" $username "', '" $password "', '" $email "', '" $motto "', '" $credits "', '" $pixels "', '" $rank "', '" $figure "', '" $gender "', '" $seckey "', '" $_SERVER['REMOTE_ADDR'] . "', '" $_SERVER['REMOTE_ADDR'] . "', '" time() . "', '" time() . "', '" $sessionKey "')");        
                    
    $user_id $this->getID($username);
                    
    $engine->query("INSERT INTO user_info (user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('"$user_id ."', '0', '0', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '0', '0')");
                    unset(
    $sessionKey);    
                                             }
            }                               
             
        final public function 
    deleteUser($k)     
        {         
            global 
    $engine;                  
             
    $engine->query("DELETE FROM users WHERE id = '" $k "' LIMIT 1");         
             
    $engine->query("DELETE FROM items WHERE userid = '" $k "' LIMIT 1");         
            
    $engine->query("DELETE FROM rooms WHERE ownerid = '" $k "' LIMIT 1");     
        }     
              
        final public function 
    updateUser($k$key$value)     
        {         
             global 
    $engine;                  
             
    $engine->query("UPDATE users SET " $key " = '" $engine->secure($value) . "' WHERE id = '" $k "' LIMIT 1");
             
    $_SESSION['user'][$key] = $engine->secure($value);        
        } 
        
        
    /*-------------------------------Handling user information-------------------------------------*/      
        
        
    final public function cacheUser($k)
        {
            global 
    $engine;              
            
    $userInfo $engine->fetch_assoc("SELECT username, rank, motto, mail, credits, activity_points, look, auth_ticket, ip_last FROM users WHERE id = '" $k "' LIMIT 1");
            
            foreach(
    $userInfo as $key => $value)
            {
                
    $this->setInfo($key$value);
            }
        }    
        
        final public function 
    setInfo($key$value)
        {
            global 
    $engine;
            
    $_SESSION['user'][$key] = $engine->secure($value);
        }

        final public function 
    getInfo($k$key)
        {
            global 
    $engine;
            if(!isset(
    $_SESSION['user'][$key]))
            {
                
    $value $engine->result("SELECT $key FROM users WHERE id = '" $engine->secure($k) . "' LIMIT 1"); 
                if(
    $value != null)
                {            
                    
    $this->setInfo($key$value);
                }
            }
                
            return 
    $_SESSION['user'][$key];
        }
        
        
        
        
    /*-------------------------------Get user ID or Username-------------------------------------*/ 
        
        
    final public function getID($k)     
        {         
            global 
    $engine;         
            return 
    $engine->result("SELECT id FROM users WHERE username = '" $engine->secure($k) . "' LIMIT 1");     
        }         
        
        final public function 
    getUsername($k)
        {
            global 
    $engine;
            return 
    $this->getInfo($_SESSION['user']['id'], 'username');
        }
        
    }
    ?>


    open your quick register page

    search for this

    Code:
    <div class="field">
                    <label for="email-address">Email</label>
                    <input type="text" id="email" size="35" name="email" value="<?php echo $template->form->reg_email; ?>" class="text-field" maxlength="48">
                </div>
    add this under

    Code:
    <div class="field">
                    <label for="email-address">Refferer (Optional)</label>
                    <input type="text" id="email" size="35" name="ref" value="<?php echo $template->form->reg_email; ?>" class="text-field" maxlength="48">
                </div>
    then add this to your me page

    Spoiler:

    Code:
    <div id="column1" class="column">
    <div class="habblet-container ">               
    <div class="cb clearfix orange "><div class="bt"><div></div></div><div class="i1"><div class="i2"><div class="i3">
     
    <div class="rounded-container"><div style="background-color: rgb(255, 255, 255);"><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(249, 150, 85);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(249, 150, 85);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div></div><h2 class="title rounded-done">Referal</h2><div style="background-color: rgb(255, 255, 255);"><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(249, 150, 85);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(249, 150, 85);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 108, 16);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(246, 98, 0);"></div></div></div></div></div></div>
     
    <div class="box-content">
       
    <center>
    {username}, tell your friends to put your name in the refferal box when they register so you can get <B>1000</b> credits!</br>
    (This was coded by Jaydenn from RageZone)
    </center>
    <br>
    <div class="rounded-container"><div style="background-color: rgb(255, 255, 255);"><div style="margin: 0px 4px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 193, 107);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(244, 165, 40);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 151, 8);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div></div></div><div style="margin: 0px 2px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 192, 105);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 1);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(245, 175, 64);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(247, 192, 105);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 1);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(247, 193, 107);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(244, 165, 40);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(242, 151, 8);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div><div class="rounded-orange rounded-done"><center>
    You invited {refferal} users!
    </center></div><div style="background-color: rgb(255, 255, 255);"><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(242, 151, 8);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(244, 165, 40);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(247, 193, 107);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 1);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(247, 192, 105);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div><div style="margin: 0px 1px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(245, 175, 64);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div><div style="margin: 0px 2px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 192, 105);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 1);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div></div><div style="margin: 0px 4px; height: 1px; overflow: hidden; background-color: rgb(255, 255, 255);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(247, 193, 107);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(244, 165, 40);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 151, 8);"><div style="height: 1px; overflow: hidden; margin: 0px 1px; background-color: rgb(242, 148, 0);"></div></div></div></div></div></div></div>
    </div>
     
     
    </div></div></div><div class="bb"><div></div></div></div>
    </div>
                    </div>


    credits; me for coding it, HabflareH for idea, and ImJoeyz hotels refferal box.

    Enjoy
    Using this on my hotel thanks, just hope there isn't any exploits

    one suggestion through on the me.php maybe code (you haven't referred any one yet) instead it says (you invited users)

  14. #14
    Planning Stuff Since 2013 Vrop93 is offline
    MemberRank
    Jan 2012 Join Date
    Grocery StoreLocation
    320Posts

    [Refferal System] RevCMS refferal system [Habbo theme]

    Try using this on your hotel with no player per ip limit xD. Users can boost their credits with this since there is no ip check


    Sent all the way from my iPod :O
    Last edited by Vrop93; 04-03-13 at 02:48 PM.

  15. #15
    Boomshakalaka resize is offline
    MemberRank
    Dec 2011 Join Date
    286Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Could you make so it workes with a refferal link? So when the user click on the link it directs you to register and after register the user who send the link gets (amount) credits? :P

    Btw nice work!

  16. #16
    Zephyr Studios PRIZM is offline
    MemberRank
    Feb 2012 Join Date
    DenmarkLocation
    2,291Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Quote Originally Posted by Vrop93 View Post
    Try using this on your hotel xD. Users can boost their credits with this since there is no ip check


    Sent all the way from my iPod :O
    Then make so users can't register twice ;)

  17. #17
    Apprentice zJoe is offline
    MemberRank
    Apr 2012 Join Date
    5Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Hey people! I really need help because I love this release and I'm going to use this release all the time!

    This is the error I get when registered (when I write the refferer)
    Fatal error: Call to a member function hashed() on a non-object in C:\xampp\htdocs\app\class.users.php on line 259

    This is the code on line 259:
    $this->addUser($template->form->reg_username, $core->hashed($template->form->reg_password), $template->form->reg_email, $_CONFIG['hotel']['motto'], $_CONFIG['hotel']['credits'], $_CONFIG['hotel']['pixels'], 1, $template->form->reg_figure, $template->form->reg_gender, $core->hashed($template->form->reg_key));

    I WILL REALLY APRECIATE SOME HELP HERE/ADVICE you know :)

    HAve a good day, and good luck using this nice script....

  18. #18
    Eye Eye Capt'n Spheral is offline
    MemberRank
    May 2010 Join Date
    TumptonshireLocation
    2,488Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Time for someone to port to uber x]

  19. #19
    Account Upgraded | Title Enabled! JaydenC is offline
    MemberRank
    Feb 2012 Join Date
    993Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    i'l update thread when i get home from school
    i think its a php version issue maybe

  20. #20
    Account Upgraded | Title Enabled! rory129 is offline
    MemberRank
    May 2009 Join Date
    МанчестLocation
    233Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    I fixed it using cloudflare

    add this to your global.php

    PHP Code:
    $_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"] ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"]; 

  21. #21
    Member Sheenieboy is offline
    MemberRank
    Jan 2012 Join Date
    66Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Quote Originally Posted by jaydenn View Post
    i'l update thread when i get home from school
    i think its a php version issue maybe
    getting this aswell...

  22. #22
    Valued Member HabbixDK is offline
    MemberRank
    Mar 2013 Join Date
    121Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    I really like this but can you make a tutorial on how to make a link like "habbo.com/ref=username" and then if they register the other user will get rewarded.

  23. #23
    Enthusiast Swift Hotel is offline
    MemberRank
    Jan 2013 Join Date
    30Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Tons of thanks for coding this! I may release working lottery system one day...

  24. #24
    Account Upgraded | Title Enabled! JaydenC is offline
    MemberRank
    Feb 2012 Join Date
    993Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    Quote Originally Posted by HabbixDK View Post
    I really like this but can you make a tutorial on how to make a link like "habbo.com/ref=username" and then if they register the other user will get rewarded.
    will do

    havent gotten around to fixing it up yet - will for sure be done when i get home today

    ps; thanks for the thanks

  25. #25
    Member lbullen is offline
    MemberRank
    Aug 2012 Join Date
    73Posts

    Re: [Refferal System] RevCMS refferal system [Habbo theme]

    I get this error
    Fatal error: Call to a member function hashed() on a non-object in C:\xampp\htdocs\app\class.users.php on line 259



Page 1 of 2 12 LastLast

Advertisement