Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

RevCMS - Help Thread

Status
Not open for further replies.
◝(⁰▿⁰)◜Smile◝ (⁰▿⁰)◜
Developer
Joined
May 29, 2007
Messages
2,167
Reaction score
899
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:
YOLO <3
Joined
Jul 6, 2013
Messages
542
Reaction score
31
[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'])."'");
 
Upvote 0
YOLO <3
Joined
Jul 6, 2013
Messages
542
Reaction score
31
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">
 
Upvote 0
Joined
Apr 17, 2012
Messages
508
Reaction score
77
Re: [RevCMS] Account ID settings accept friendrequests

t
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 ( ) 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:
Upvote 0
YOLO <3
Joined
Jul 6, 2013
Messages
542
Reaction score
31
Re: [RevCMS] Account ID settings accept friendrequests

t
You also need form tags. You need css for a slider ( ) 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?
 
Upvote 0
YOLO <3
Joined
Jul 6, 2013
Messages
542
Reaction score
31
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?
 
Upvote 0
Experienced Elementalist
Joined
Nov 11, 2015
Messages
238
Reaction score
89
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?

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 !
 
Upvote 0
Joined
Apr 17, 2012
Messages
508
Reaction score
77
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;


Btw, you could also create you're own button easily:
 
Last edited:
Upvote 0
YOLO <3
Joined
Jul 6, 2013
Messages
542
Reaction score
31
Re: [RevCMS] Account ID settings accept friendrequests

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?



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;


Btw, you could also create you're own button easily:
But I first have to start with PHP right, check out my previous post.
 
Upvote 0
Newbie Spellweaver
Joined
Nov 18, 2016
Messages
24
Reaction score
0
revcms news

hey,

my news articles works but this happens


please help, I post from HK, its really weird(revcms)
 
Upvote 0
Experienced Elementalist
Joined
Aug 10, 2011
Messages
270
Reaction score
23
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
 
Upvote 0
Experienced Elementalist
Joined
Dec 30, 2010
Messages
204
Reaction score
23
Re: revcms news

I think it's more likely caused by the filtering of your text to avoid having any XSS exploits.
 
Upvote 0
YOLO <3
Joined
Jul 6, 2013
Messages
542
Reaction score
31
Re: [RevCMS] Account ID settings accept friendrequests

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
bae0202f612a40445c4853556cf56ad9 - RevCMS - Help Thread - RaGEZONE Forums



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");
 

Attachments

You must be registered for see attachments list
Last edited:
Upvote 0
Status
Not open for further replies.
Back
Top