[REVCMS] Account settings addon

Results 1 to 10 of 10
  1. #1
    Valued Member Mush is offline
    MemberRank
    Oct 2012 Join Date
    NorwayLocation
    118Posts

    config [REVCMS] Account settings addon

    Hey,

    I know this is out there, but it is surely someone in need who are not so good at finding.

    So this is an add for account settings, block friends requests, follow visibility, online visibility and some others.

    hehe.png

    First, go to,
    app\tpl\skins\(your skin)\account.php (or whatever the account settings file is)

    Find this similar code, and replace with the code below. From <form method="post" id="profileForm"> TO </form>

    PHP Code:
    <form method="post" id="profileForm">
                                                <
    h3>Your motto</h3>
                                                <
    p>Your motto is what other users will see on your {hotelNameHome page and when clicking your user in the Hotel.</p>
                                                <
    p><label>Motto:<input type="text" name="acc_motto" size="32" maxlength="32" value="{motto}" id="avatarmotto"></label></p>
                                             
    <
    h3>Block Trading</h3>
                                                <
    p>Setting to "0" will not allow any user to trade youSetting to "1" will allow any user to trade you.</p>
                                                <
    p><label>Setting:<input type="text" name="acc_trade" size="32" maxlength="32" value="{acc_trade}" id="avatarmotto"></label></p>
                                             
    <
    h3>Block New Friends</h3>
                                                <
    p>Setting to "1" will not allow any user to add youSetting to "0" will allow any user to add you.</p>
                                                <
    p><label>Setting:<input type="text" name="acc_frndreq" size="32" maxlength="32" value="{acc_frndreq}" id="avatarmotto"></label></p>
                                           
                                                <
    h3>Online Visibility</h3>
                                                <
    p>Setting to "1" will not allow other users to notice your online statusSetting to "0" will allow other users to notice your online status.  <br/>    ON OFF</p>
                                                <
    p><label>Setting:<input type="text" name="acc_online" size="32" maxlength="32" value="{acc_online}" id="avatarmotto"></label></p>
                                           
                                                <
    h3>Follow Ability</h3>
                                                <
    p>Setting to "1" will not allow your friends to Follow youSetting to "0" will allow your friends to follow you.<br/>    ON OFF</p>
                                                <
    p><label>Setting:<input type="text" name="acc_follow" size="32" maxlength="32" value="{acc_follow}" id="avatarmotto"></label></p>
                                           
                                                <
    h3>Your email address</h3>
                                                <
    p>Your email address is what you may need to reset your password incase you forget it.</p>
                                                <
    p><label>Email:<input type="text" name="acc_email" size="32" value="{email}" id="avatarmotto"></p>
                                                <
    h3>Current Password</h3>
                                                <
    p>Your current password is the password you use to login to the main websiteOnly fill this in if you wish to change your login password.</p>
                                                <
    p><label>Password:<input type="password" name="acc_old_password" value="" id="avatarmotto"></p>
                                                <
    h3>New Password</h3>
                                                <
    p>Please only change this field if you wish to change your login password.</p>
                                                <
    p><label>New Password:<input type="password" name="acc_new_password" value="" id="avatarmotto"></p>                                   
                                       
                                                <
    div class="settings-buttons">
                                                    <
    input type="submit" value="Save changes" name="account" class="submit" style="float:right">
                                                </
    div>
                                            </
    form
    Then, CTRL+S (saves), then exit out of that document.
    -----------------------------------------------------------------------------

    Next, go to, app\class.users.php find Account Settings, and replace with the code below.

    PHP Code:
    /*-------------------------------Account settings-------------------------------------*/
     
        
    final public function updateAccount()
        {
            global 
    $template$_CONFIG$core$engine;
     
            if(isset(
    $_POST['account']))
            {
     
                    if(isset(
    $_POST['acc_frndreq']) && strlen($_POST['acc_frndreq']) < && $_POST['acc_frndreq'] != $this->getInfo($_SESSION['user']['id'], 'block_newfriends'))
                {
                    
    $this->updateUser($_SESSION['user']['id'], 'block_newfriends'$engine->secure($_POST['acc_frndreq']));
                    
    header('Location: '.$_CONFIG['hotel']['url'].'/account');
                    exit;
                }
                else
                {
                    
    $template->form->error 'Setting is invalid.';
                }
     
         
     
     
                    if(isset(
    $_POST['acc_trade']) && strlen($_POST['acc_trade']) < && $_POST['acc_trade'] != $this->getInfo($_SESSION['user']['id'], 'accept_trading'))
                {
                    
    $this->updateUser($_SESSION['user']['id'], 'accept_trading'$engine->secure($_POST['acc_trade']));
                    
    header('Location: '.$_CONFIG['hotel']['url'].'/account');
                    exit;
                }
                else
                {
                    
    $template->form->error 'Setting is invalid.';
                }
     
     
                if(isset(
    $_POST['acc_online']) && strlen($_POST['acc_online']) < && $_POST['acc_online'] != $this->getInfo($_SESSION['user']['id'], 'hide_online'))
                {
                    
    $this->updateUser($_SESSION['user']['id'], 'hide_online'$engine->secure($_POST['acc_online']));
                    
    header('Location: '.$_CONFIG['hotel']['url'].'/account');
                    exit;
                }
                else
                {
                    
    $template->form->error 'Setting is invalid.';
                }
     
                if(isset(
    $_POST['acc_follow']) && strlen($_POST['acc_follow']) < && $_POST['acc_follow'] != $this->getInfo($_SESSION['user']['id'], 'hide_inroom'))
                {
                    
    $this->updateUser($_SESSION['user']['id'], 'hide_inroom'$engine->secure($_POST['acc_follow']));
                    
    header('Location: '.$_CONFIG['hotel']['url'].'/account');
                    exit;
                }
                else
                {
                    
    $template->form->error 'Setting is invalid.';
     
                }
     
     
     
                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);
        } 
    Then, CTRL+S (saves), then exit out of that document.
    ------------------------------------------------------------------------
    Next, go to, app\class.template.php

    Find the code below,

    PHP Code:
    if($users->isLogged())
            {
                
    $this->setParams('username'$users->getInfo($_SESSION['user']['id'], 'username'));
                
    $this->setParams('rank'$users->getInfo($_SESSION['user']['id'], 'rank'));
                
    $this->setParams('motto'$users->getInfo($_SESSION['user']['id'], 'motto'));
                
    $this->setParams('email'$users->getInfo($_SESSION['user']['id'], 'mail'));
                
    $this->setParams('coins'$users->getInfo($_SESSION['user']['id'] ,'credits'));
                
    $this->setParams('activitypoints'$users->getInfo($_SESSION['user']['id'], 'activity_points'));
                
    $this->setParams('shells'$users->getInfo($_SESSION['user']['id'], 'vip_points'));
                
    $this->setParams('figure'$users->getInfo($_SESSION['user']['id'], 'look'));
                
    $this->setParams('ip_last'$users->getInfo($_SESSION['user']['id'], 'ip_last'));
                
    $this->setParams('lastSignedIn',  date('M j, Y H:i:s A'$users->getInfo($_SESSION['user']['id'],  'last_online'))); 
    Add the code below, underneath the existing code,

    PHP Code:
    $this->setParams('acc_frndreq'$users->getInfo($_SESSION['user']['id'], 'block_newfriends'));
                
    $this->setParams('acc_trade'$users->getInfo($_SESSION['user']['id'], 'accept_trading'));
                
    $this->setParams('acc_online'$users->getInfo($_SESSION['user']['id'], 'hide_online'));
                
    $this->setParams('acc_follow'$users->getInfo($_SESSION['user']['id'], 'hide_inroom')); 
    Enjoy, btw this fix is not mine.


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

    Re: [REVCMS] Account settings addon

    There is another version of this with radiobuttons and not textboxes. Google it.

  3. #3
    Account Upgraded | Title Enabled! Kristopher is offline
    MemberRank
    Sep 2011 Join Date
    266Posts

    Re: [REVCMS] Account settings addon

    Good release. However why not use something like
    <input type='radio' name='os' value='1' >No one
    <input type='radio' name='os' value='0' checked>All
    <br><br>

    <h3>Follow me:</h3>
    <p>Choose who gets to follow you from room to room:</p>
    <input type='radio' name='fm' value='1' >No one
    <input type='radio' name='fm' value='0' checked>My Friends/Anyone

    Just pulled from control u from my hotle.

  4. #4
    Valued Member Mush is offline
    MemberRank
    Oct 2012 Join Date
    NorwayLocation
    118Posts

    Re: [REVCMS] Account settings addon

    Quote Originally Posted by Exonize View Post
    There is another version of this with radiobuttons and not textboxes. Google it.
    Please read this part: ''I know this is out there, but it is surely someone in need who are not so good at finding.''

    I know that, Einstein.

    Quote Originally Posted by Kristopher View Post
    Good release. However why not use something like
    <input type='radio' name='os' value='1' >No one
    <input type='radio' name='os' value='0' checked>All
    <br><br>

    <h3>Follow me:</h3>
    <p>Choose who gets to follow you from room to room:</p>
    <input type='radio' name='fm' value='1' >No one
    <input type='radio' name='fm' value='0' checked>My Friends/Anyone

    Just pulled from control u from my hotle.
    Hehe, ask the person who made it :)

  5. #5
    Novice Zacus is offline
    MemberRank
    Aug 2011 Join Date
    1Posts

    Re: [REVCMS] Account settings addon

    I have googled for radiobuttons, ending up with no resault.. I would be happy for the radiobutton versin instead of this..
    Thanks

  6. #6
    Account Upgraded | Title Enabled! r63 is offline
    MemberRank
    Jan 2012 Join Date
    apt-get GPSLocation
    430Posts

    Re: [REVCMS] Account settings addon

    Horrible use of text boxes

  7. #7
    1 + 3 + 3 = 7 EvilCoder is offline
    MemberRank
    Jul 2009 Join Date
    /home/mvdworpLocation
    334Posts

    Re: [REVCMS] Account settings addon

    Very nice release. I might release a CMS that has all of this already and is not PHPRetro, UberCMS or RevCMS... It is much lighter and has a load time of 0,1 seconds.. Very cool... But anyway! Thanks for this release. Should help alot of people.

  8. #8
    i am a person Riley H is offline
    MemberRank
    Mar 2010 Join Date
    United StatesLocation
    203Posts

    Re: [REVCMS] Account settings addon

    Why not just use a radio form?

  9. #9
    Proficient Member owot is offline
    MemberRank
    Jun 2010 Join Date
    185Posts

    Re: [REVCMS] Account settings addon

    Horrible, radio would be a lot better..

  10. #10
    Member 11Johan11 is offline
    MemberRank
    Mar 2013 Join Date
    Habbo SectionLocation
    74Posts

    Re: [REVCMS] Account settings addon

    Cant find the radiobuttons.... Someone knows where?



Advertisement