RevCMS - Help Thread

Page 1 of 2 12 LastLast
Results 1 to 25 of 28
  1. #1
    ◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜ Taiga is offline
    DeveloperRank
    May 2007 Join Date
    InternetLocation
    2,464Posts

    RevCMS - Help Thread

    Post your help requests related to the RevCMS here.

    Please use the SPOILER tags if you're going to post screenshots or a large chunk of code.
    Also make sure your code is between the CODE tags to make it easier to read.

    WARNING:
    When replying to a post, QUOTE the post. There's a link under the user's post "Reply With Quote" - use it. If you're not replying to a question with quote, it will be considered as Spam.

    Please try to only QUOTE the PARTS that you are replying to instead of the full post!

    If the error is Emulator releated, then please make sure to add your emulator version. There are a lot of emulator edits out there, and we would like the questions to be posted in one thread only.
    @Shoelace, @Droppy, @Shorty, @asesinato
    Last edited by Taiga; 13-12-16 at 04:30 PM. Reason: Updated content


  2. #2
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    [RevCMS] Account ID settings accept friendrequests

    I'm looking for a RevCMS system in the page account ID settings which can turn on AND turn off friend requests in the client (PhoenixEMU).

    So it requires these 2 kind of queries:
    Code:
    mysql_query ("UPDATE users SET block_newfriends = '1' WHERE id = '".mysql_real_escape_string($_GET['userid'])."'");
    and
    Code:
    mysql_query ("UPDATE users SET block_newfriends = '0' WHERE id = '".mysql_real_escape_string($_GET['userid'])."'");

  3. #3
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    So nobody knows how I can put this in account.php ?

    Code:
      <h3>Je missie</h3>                                            <p>Je missie kan je zien in het hotel, verzin er eentje!</p>
                                                <p><label>Missie:<input type="text" name="acc_motto" size="32" maxlength="32" value="{motto}" id="avatarmotto"></label></p>
                                                <h3>Je e-mail</h3>
                                                <p>Je e-mail heb je nodig als je je wachtwoord bent vergeten.</p>
                                                <p><label>E-mail:<input type="text" name="acc_email" size="32" value="{email}" id="avatarmotto"></p>
                                                <h3>Huidig wachtwoord</h3>
                                                <p>Je huidig wachtwoord gebruik je om Mine te bezoeken. Vul hem in als je je wachtwoord wilt veranderen.</p>
                                                <p><label>Wachtwoord:<input type="password" name="acc_old_password" value="" id="avatarmotto"></p>
                                                <h3>Nieuw wachtwoord</h3>
                                                <p>Wil je een nieuw wachtwoord? Dan kan je die hieronder veranderen. Let er op dat jouw nieuwe wachtwoord uit minimaal <b>8 karakters</b> moet bestaan.</p>
                                                <p><label>Nieuw wachtwoord:<input type="password" name="acc_new_password" value="" id="avatarmotto"></p>
                                                <div class="settings-buttons">
                                                    <input type="submit" value="Opslaan" name="account" class="submit" style="float:right">

  4. #4
    Account Upgraded | Title Enabled! streamhotel is offline
    MemberRank
    Apr 2012 Join Date
    EarthLocation
    511Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    t
    Quote Originally Posted by DutchenL View Post
    So nobody knows how I can put this in account.php ?

    Code:
      <h3>Je missie</h3>                                            <p>Je missie kan je zien in het hotel, verzin er eentje!</p>
                                                <p><label>Missie:<input type="text" name="acc_motto" size="32" maxlength="32" value="{motto}" id="avatarmotto"></label></p>
                                                <h3>Je e-mail</h3>
                                                <p>Je e-mail heb je nodig als je je wachtwoord bent vergeten.</p>
                                                <p><label>E-mail:<input type="text" name="acc_email" size="32" value="{email}" id="avatarmotto"></p>
                                                <h3>Huidig wachtwoord</h3>
                                                <p>Je huidig wachtwoord gebruik je om Mine te bezoeken. Vul hem in als je je wachtwoord wilt veranderen.</p>
                                                <p><label>Wachtwoord:<input type="password" name="acc_old_password" value="" id="avatarmotto"></p>
                                                <h3>Nieuw wachtwoord</h3>
                                                <p>Wil je een nieuw wachtwoord? Dan kan je die hieronder veranderen. Let er op dat jouw nieuwe wachtwoord uit minimaal <b>8 karakters</b> moet bestaan.</p>
                                                <p><label>Nieuw wachtwoord:<input type="password" name="acc_new_password" value="" id="avatarmotto"></p>
                                                <div class="settings-buttons">
                                                    <input type="submit" value="Opslaan" name="account" class="submit" style="float:right">
    You also need form tags. You need css for a slider (How To Create a Toggle Switch) and integrate them in your HTML code. Why a slider? I assume it's more user friendly then just a textbox where you must set 0 or 1. Read out input from that slider and also check in php if state is 0 or 1, otherwise you'll throw a error.

    Make sure that also the current state is set correctly.
    Last edited by streamhotel; 07-12-16 at 05:37 PM.

  5. #5
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    Quote Originally Posted by streamhotel View Post
    t
    You also need form tags. You need css for a slider (How To Create a Toggle Switch) and integrate them in your HTML code. Why a slider? I assume it's more user friendly then just a textbox where you must set 0 or 1. Read out input from that slider and also check in php if state is 0 or 1, otherwise you'll throw a error.

    Make sure that also the current state is set correctly.
    Can you help me with it?

  6. #6
    Account Upgraded | Title Enabled! streamhotel is offline
    MemberRank
    Apr 2012 Join Date
    EarthLocation
    511Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    Quote Originally Posted by DutchenL View Post
    Can you help me with it?
    Try it by yourself! Isn't that hard. If you get any issues feel free to post a help thread.

  7. #7
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    Code:
    <!DOCTYPE html><html>
    <head>
    <style>
    .switch {
      position: relative;
      display: inline-block;
      width: 60px;
      height: 34px;
    }
    
    
    .switch input {display:none;}
    
    
    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #ccc;
      -webkit-transition: .4s;
      transition: .4s;
    }
    
    
    .slider:before {
      position: absolute;
      content: "";
      height: 26px;
      width: 26px;
      left: 4px;
      bottom: 4px;
      background-color: white;
      -webkit-transition: .4s;
      transition: .4s;
    }
    
    
    input:checked + .slider {
      background-color: #2196F3;
    }
    
    
    input:focus + .slider {
      box-shadow: 0 0 1px #2196F3;
    }
    
    
    input:checked + .slider:before {
      -webkit-transform: translateX(26px);
      -ms-transform: translateX(26px);
      transform: translateX(26px);
    }
    
    
    /* Rounded sliders */
    .slider.round {
      border-radius: 34px;
    }
    
    
    .slider.round:before {
      border-radius: 50%;
    }
    </style>
    </head>
    <body>
    
    
    <h2>Toggle Switch</h2>
    
    
    
    
    Turn friend requests off/on:<br>
    <?php
    mysql_query ("UPDATE users SET block_newfriends = '1' WHERE id = '".mysql_real_escape_string($_GET['userid'])."'") IF block_newfriends = '0';
    ?>
    
    
    <label class="switch">
      <input type="checkbox">
      <div class="slider round"></div>
    </label>
    
    
    
    
    </body>
    </html>
    This doesnt work?

  8. #8
    The **** Keiz is offline
    MemberRank
    Nov 2015 Join Date
    238Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    Quote Originally Posted by DutchenL View Post
    Code:
    <!DOCTYPE html><html>
    <head>
    <style>
    .switch {
      position: relative;
      display: inline-block;
      width: 60px;
      height: 34px;
    }
    
    
    .switch input {display:none;}
    
    
    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #ccc;
      -webkit-transition: .4s;
      transition: .4s;
    }
    
    
    .slider:before {
      position: absolute;
      content: "";
      height: 26px;
      width: 26px;
      left: 4px;
      bottom: 4px;
      background-color: white;
      -webkit-transition: .4s;
      transition: .4s;
    }
    
    
    input:checked + .slider {
      background-color: #2196F3;
    }
    
    
    input:focus + .slider {
      box-shadow: 0 0 1px #2196F3;
    }
    
    
    input:checked + .slider:before {
      -webkit-transform: translateX(26px);
      -ms-transform: translateX(26px);
      transform: translateX(26px);
    }
    
    
    /* Rounded sliders */
    .slider.round {
      border-radius: 34px;
    }
    
    
    .slider.round:before {
      border-radius: 50%;
    }
    </style>
    </head>
    <body>
    
    
    <h2>Toggle Switch</h2>
    
    
    
    
    Turn friend requests off/on:<br>
    <?php
    mysql_query ("UPDATE users SET block_newfriends = '1' WHERE id = '".mysql_real_escape_string($_GET['userid'])."'") IF block_newfriends = '0';
    ?>
    
    
    <label class="switch">
      <input type="checkbox">
      <div class="slider round"></div>
    </label>
    
    
    
    
    </body>
    </html>
    This doesnt work?
    Thank god it doesn't.
    First of all don't spaghetti code, if you're using RevCMS, follow its standards, simply alter the function in the \app\class.users.php : updateAccount()
    That's where your other data is saved too, new password, email etc.
    Try to experiment with that code !

  9. #9
    Account Upgraded | Title Enabled! streamhotel is offline
    MemberRank
    Apr 2012 Join Date
    EarthLocation
    511Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    Hey!

    This looks okay but follow rev's pattern. Include css related things in the appropriate file instead of mixing it with your html code. Of course it wouldn't work, you've didn't placed it between form tags. You could use Javascript to find register it's state.

    How to do that, you'll find here;
    html - How to create an on/off switch with Javascript/CSS? - Stack Overflow

    Btw, you could also create you're own button easily:
    https://proto.io/freebies/onoff/
    Last edited by streamhotel; 10-12-16 at 05:44 PM.

  10. #10
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    Quote Originally Posted by Keiz View Post
    Thank god it doesn't.
    First of all don't spaghetti code, if you're using RevCMS, follow its standards, simply alter the function in the \app\class.users.php : updateAccount()
    That's where your other data is saved too, new password, email etc.
    Try to experiment with that code !
    This is from there, the account settings:
    Code:
    /*-------------------------------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);
    	}
    Now I have to add something like friend_request in it but how should I do that?

    - - - Updated - - -

    Quote Originally Posted by streamhotel View Post
    Hey!

    This looks okay but follow rev's pattern. Include css related things in the appropriate file instead of mixing it with your html code. Of course it wouldn't work, you've didn't placed it between form tags. You could use Javascript to find register it's state.

    How to do that, you'll find here;
    html - How to create an on/off switch with Javascript/CSS? - Stack Overflow

    Btw, you could also create you're own button easily:
    https://proto.io/freebies/onoff/
    But I first have to start with PHP right, check out my previous post.

  11. #11
    Apprentice mentorttt is offline
    MemberRank
    Nov 2016 Join Date
    24Posts

    revcms news

    hey,

    my news articles works but this happens
    Screenshot by Lightshot

    please help, I post from HK, its really weird(revcms)

  12. #12
    Account Upgraded | Title Enabled! Bozzie is offline
    MemberRank
    Aug 2011 Join Date
    ur mumLocation
    275Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    <?PHP

    if(isset($_POST['update'])) {
    $bf=mysql_real_escape_string($_POST['bf']);
    $os=mysql_real_escape_string($_POST['os']);
    $fm=mysql_real_escape_string($_POST['fm']);
    $am=mysql_real_escape_string($_POST['am']);
    $user=mysql_real_escape_string($_POST['user']);
    switch ($bf){
    case "":
    mysql_query("UPDATE users SET motto='$am', block_newfriends='1', hide_online='$os', hide_inroom='$fm' WHERE username='$user'") or die(mysql_error());
    break;
    case "2":
    mysql_query("UPDATE users SET motto='$am', block_newfriends='0', hide_online='$os', hide_inroom='$fm' WHERE username='$user'") or die(mysql_error());
    break;
    }



    echo '<div class="rounded-container">';
    include("includes/greenbox1.php");
    echo '<div class="rounded-green rounded-done">';
    echo '<b>Your profile has been updated!</b><br>';
    echo '</div>';
    include("includes/greenbox2.php");
    echo '</div>';
    }
    ?>
    <form method="post" style="background: rgba(0,0,0,0);border-radius:4px;padding:3px;color:#FFFF;">
    <input type="hidden" name="user" value="{username}" />

    <?php
    $query = "SELECT * FROM users WHERE id = '".$_SESSION['user']['id']."'";
    $result = mysql_query($query);
    $row = mysql_fetch_array($result);
    $x1 = $row['block_newfriends'];
    $x2 = $row['hide_online'];
    $x3 = $row['hide_inroom'];
    $ch1[$x1] = "checked";
    $ch2[$x2] = "checked";
    $ch3[$x3] = "checked";
    echo "
    <h3>Friend requests</h3>";
    if ( $x1 = '1' ) {
    echo "<input type='checkbox' name='bf' value='2' ".$ch1['0'].">Decline friend requests:";
    } else {
    echo "<input type='checkbox' name='bf' value='1' ".$ch1['1'].">Accept friend requests:";
    }
    echo "<br><br>
    ";

    echo "
    <h3>Online status</h3>
    <p>Choose thoose who can see you online:</p>
    <input type='radio' name='os' value='1' ".$ch2['1'].">No one
    <input type='radio' name='os' value='0' ".$ch2['0'].">Everyone
    <br><br>
    ";

    echo "
    <h3>Follow me</h3>
    <p>Choose those who can follow you into rooms:</p>
    <input type='radio' name='fm' value='1' ".$ch3['1'].">No one
    <input type='radio' name='fm' value='0' ".$ch3['0'].">My friends
    ";
    ?>
    from my account for block new friends

  13. #13
    Don't mind me, i'm nobody Jambokill is offline
    MemberRank
    Dec 2010 Join Date
    PhilippinesLocation
    264Posts

    Re: revcms news

    I think it's more likely caused by the filtering of your text to avoid having any XSS exploits.

  14. #14
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    Quote Originally Posted by Bozzie View Post
    from my account for block new friends
    I tried this but it doesn't save for some reason. it stays like this even if I save



    Can you post your full account.php if it's revCMS?
    Can you also post these files?
    Code:
    include("includes/greenbox1.php");
    include("includes/greenbox2.php");
    Last edited by DutchenL; 11-12-16 at 04:45 PM.

  15. #15
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: RevCMS - Help Thread

    anyone an idea..?

  16. #16
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: RevCMS - Help Thread

    bump..

  17. #17
    Member swe is offline
    MemberRank
    Dec 2016 Join Date
    64Posts

    Re: RevCMS - Help Thread

    Quote Originally Posted by DutchenL View Post
    bump..
    you are bumping yours question.

    gl with ur life.

  18. #18
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: RevCMS - Help Thread

    yeah nobody knows it for some reason

  19. #19
    Member swe is offline
    MemberRank
    Dec 2016 Join Date
    64Posts

    Re: RevCMS - Help Thread

    Quote Originally Posted by DutchenL View Post
    yeah nobody knows it for some reason
    you are almost the only one who has written on this topic.

  20. #20
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: RevCMS - Help Thread

    yeah this thread doesn't help, would be better to seperate it

  21. #21
    Apprentice Kellz is offline
    MemberRank
    Dec 2016 Join Date
    24Posts

    Re: RevCMS - Help Thread

    Quote Originally Posted by DutchenL View Post
    yeah this thread doesn't help, would be better to seperate it
    People have already given you help and you have chosen to just be spoonfed. You have already been pointed in the right direction by @Keiz and @Bozzie, now all you have to do is play around with code and read online tutorials to make it work for your CMS.

  22. #22
    Member swe is offline
    MemberRank
    Dec 2016 Join Date
    64Posts

    Re: RevCMS - Help Thread

    Quote Originally Posted by DutchenL View Post
    yeah this thread doesn't help, would be better to seperate it
    This will gonna be your lifes best choise.

    Change. Ur. CMS.

  23. #23
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: RevCMS - Help Thread

    Quote Originally Posted by Kellz View Post
    People have already given you help and you have chosen to just be spoonfed. You have already been pointed in the right direction by @Keiz and @Bozzie, now all you have to do is play around with code and read online tutorials to make it work for your CMS.
    I tried but it didnt work

  24. #24
    Valued Member Mackors is offline
    MemberRank
    Aug 2016 Join Date
    100Posts

    Re: RevCMS - Help Thread

    Quote Originally Posted by DutchenL View Post
    I tried but it didnt work
    We can't see what you are doing wrong.

    Add a error report in your .php file.

    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);

    Now try to save the 'Friendrequest' and it should give a error.

  25. #25
    YOLO <3 DutchenL is offline
    MemberRank
    Jul 2013 Join Date
    543Posts

    Re: [RevCMS] Account ID settings accept friendrequests

    Quote Originally Posted by DutchenL View Post
    Code:
    <!DOCTYPE html><html>
    <head>
    <style>
    .switch {
      position: relative;
      display: inline-block;
      width: 60px;
      height: 34px;
    }
    
    
    .switch input {display:none;}
    
    
    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #ccc;
      -webkit-transition: .4s;
      transition: .4s;
    }
    
    
    .slider:before {
      position: absolute;
      content: "";
      height: 26px;
      width: 26px;
      left: 4px;
      bottom: 4px;
      background-color: white;
      -webkit-transition: .4s;
      transition: .4s;
    }
    
    
    input:checked + .slider {
      background-color: #2196F3;
    }
    
    
    input:focus + .slider {
      box-shadow: 0 0 1px #2196F3;
    }
    
    
    input:checked + .slider:before {
      -webkit-transform: translateX(26px);
      -ms-transform: translateX(26px);
      transform: translateX(26px);
    }
    
    
    /* Rounded sliders */
    .slider.round {
      border-radius: 34px;
    }
    
    
    .slider.round:before {
      border-radius: 50%;
    }
    </style>
    </head>
    <body>
    
    
    <h2>Toggle Switch</h2>
    
    
    
    
    Turn friend requests off/on:<br>
    <?php
    mysql_query ("UPDATE users SET block_newfriends = '1' WHERE id = '".mysql_real_escape_string($_GET['userid'])."'") IF block_newfriends = '0';
    ?>
    
    
    <label class="switch">
      <input type="checkbox">
      <div class="slider round"></div>
    </label>
    
    
    
    
    </body>
    </html>
    This doesnt work?
    Quote Originally Posted by Mackors View Post
    We can't see what you are doing wrong.

    Add a error report in your .php file.

    ini_set('display_errors', 1);
    ini_set('display_startup_errors', 1);
    error_reporting(E_ALL);

    Now try to save the 'Friendrequest' and it should give a error.
    Ihadthis



Page 1 of 2 12 LastLast

Advertisement