Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Account Settings using <select>
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Jerry" data-source="post: 431676" data-attributes="member: 35321"><p>I did something like this (from my old CMS back in 2016):</p><p></p><p>[CODE]if (isset($_POST['onlineVisible']))</p><p> {</p><p> $ovis = $app->filter($_POST['onlineVisible']);</p><p> </p><p> if ($users->getUserVariable($_SESSION['user']['id'], 'hide_online') != (($ovis == false) ? '1' : '0'))</p><p> {</p><p> $success = 'Your account settings has been successfully updated.';</p><p> $db->query("UPDATE `users` SET `hide_online` = '" . (($ovis == false) ? '1' : '0') . "' WHERE `id` = '" . $_SESSION['user']['id'] . "'");</p><p> }</p><p> }</p><p> else</p><p> {</p><p> if ($users->getUserVariable($_SESSION['user']['id'], 'hide_online') != 1)</p><p> {</p><p> $success = 'Your account settings has been successfully updated.';</p><p> $db->query("UPDATE `users` SET `hide_online` = '1' WHERE `id` = '" . $_SESSION['user']['id'] . "'");</p><p> }</p><p> }</p><p> </p><p> if (isset($_POST['friendRequestsAllowed']))</p><p> {</p><p> $fr_b = $app->filter($_POST['friendRequestsAllowed']);</p><p> </p><p> if ($users->getUserVariable($_SESSION['user']['id'], 'block_newfriends') != (($fr_b == false) ? '1' : '0'))</p><p> {</p><p> $success = 'Your account settings has been successfully updated.';</p><p> $db->query("UPDATE `users` SET `block_newfriends` = '" . (($fr_b == false) ? '1' : '0') . "' WHERE `id` = '" . $_SESSION['user']['id'] . "'");</p><p> }</p><p> }</p><p> else</p><p> {</p><p> if ($users->getUserVariable($_SESSION['user']['id'], 'block_newfriends') != 1)</p><p> {</p><p> $success = 'Your account settings has been successfully updated.';</p><p> $db->query("UPDATE `users` SET `block_newfriends` = '1' WHERE `id` = '" . $_SESSION['user']['id'] . "'");</p><p> }</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="Jerry, post: 431676, member: 35321"] I did something like this (from my old CMS back in 2016): [CODE]if (isset($_POST['onlineVisible'])) { $ovis = $app->filter($_POST['onlineVisible']); if ($users->getUserVariable($_SESSION['user']['id'], 'hide_online') != (($ovis == false) ? '1' : '0')) { $success = 'Your account settings has been successfully updated.'; $db->query("UPDATE `users` SET `hide_online` = '" . (($ovis == false) ? '1' : '0') . "' WHERE `id` = '" . $_SESSION['user']['id'] . "'"); } } else { if ($users->getUserVariable($_SESSION['user']['id'], 'hide_online') != 1) { $success = 'Your account settings has been successfully updated.'; $db->query("UPDATE `users` SET `hide_online` = '1' WHERE `id` = '" . $_SESSION['user']['id'] . "'"); } } if (isset($_POST['friendRequestsAllowed'])) { $fr_b = $app->filter($_POST['friendRequestsAllowed']); if ($users->getUserVariable($_SESSION['user']['id'], 'block_newfriends') != (($fr_b == false) ? '1' : '0')) { $success = 'Your account settings has been successfully updated.'; $db->query("UPDATE `users` SET `block_newfriends` = '" . (($fr_b == false) ? '1' : '0') . "' WHERE `id` = '" . $_SESSION['user']['id'] . "'"); } } else { if ($users->getUserVariable($_SESSION['user']['id'], 'block_newfriends') != 1) { $success = 'Your account settings has been successfully updated.'; $db->query("UPDATE `users` SET `block_newfriends` = '1' WHERE `id` = '" . $_SESSION['user']['id'] . "'"); } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Account Settings using <select>
Top