Clit
Posting Freak
- Feb 25, 2012
- 1,065
- 103
PHP:
<h3>Trading Setting</h3>
<select name="acc_trading" id="avatarmotto" value="{acc_trading}">
<option value="1">Enable</option>
<option value="0">Disable</option> </select>
<h3>Friend Requests</h3>
<select name="acc_frndreq" value="{acc_frndreq}">
<option value="0">Enabled</option>
<option value="1">Disabled</option> </select>
<h3>Online Status</h3>
<select name="acc_online" id="avatarmotto" value="{acc_online}">
<option value="1">Nobody</option>
<option value="0">Everybody</option> </select>
<h3>Follow Me Settings</h3>
<select name="acc_follow" id="avatarmotto" value="{acc_follow}">
<option value="1">Nobody</option>
<option value="0">My Friends</option> </select>
The code below needs to be fixed up to work with the code above.
PHP:
if(isset($_POST['acc_frndreq']) && strlen($_POST['acc_frndreq']) < 2 && $_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']) < 2 && $_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']) < 2 && $_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']) < 2 && $_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.';
}
It is expecting to be less than 2 characters, (was text boxes before)
So you know, obviously you know that :s
Please & Thank-You in advance.