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
How to enable and disable friend requests (Help Please)
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="Ben144" data-source="post: 467721" data-attributes="member: 73963"><p>Hey,</p><p></p><p>I have created a simple settings page for the FluxRP Emulator ect and I have added an option for when a player click on the relevant button, then it will either disable or enable friend requests ect, but it is not working as when i add the php code, then the cms just breaks and when i remove the code, then the button doesn't work at all.</p><p></p><p>[CODE]<div class="content-box"></p><p> <div class="title">Friend Requests</div></p><p> <div class="box-content d-flex justify-content-center align-items-center"></p><p> <?php</p><p></p><p> if (isset($_POST['profileForm'])) {</p><p> </p><p> $efr = filter($_POST['friendRequestsAllowed']);</p><p> </p><p> if ($efr == 1) {</p><p> </p><p> echo '<div class="ml-3 mr-auto">You currently have friend requests <b>Disabled</b></div>'</p><p> </p><p> mysql_query("UPDATE users SET block_newfriends = '0' WHERE id = '" . $_SESSION['user']['id'] . "'");</p><p> }</p><p> else if ($efr == 0) {</p><p> </p><p> echo '<div class="ml-3 mr-auto">You currently have friend requests <b>Enabled</b></div>'</p><p> </p><p> mysql_query("UPDATE users SET block_newfriends = '1' WHERE id = '" . $_SESSION['user']['id'] . "'");</p><p> }</p><p> }</p><p></p><p>?></p><p> <div class="mr-3"></p><p> <form method="post" id="profileForm" class="form-block"></p><p> <input type="hidden" name="_token" value="4e26eaf44aedd954ff26441a92b2b42bbe4d1ada"></p><p> <input type="hidden" name="block_friend_requests" value="" value="true"></p><p> <?php</p><p></p><p> if (isset($_POST['profileForm'])) {</p><p> </p><p> $efr = filter($_POST['friendRequestsAllowed']);</p><p> </p><p> if ($efr == 1) {</p><p> </p><p> echo '<button type="submit" name="friendRequestsAllowed" class="button green">Disable</button>'</p><p> </p><p> mysql_query("UPDATE users SET block_newfriends = '0' WHERE id = '" . $_SESSION['user']['id'] . "'");</p><p> }</p><p> else if ($efr == 0) {</p><p> </p><p> echo '<button type="submit" name="friendRequestsAllowed" class="button green">Enabled</button>'</p><p> </p><p> mysql_query("UPDATE users SET block_newfriends = '1' WHERE id = '" . $_SESSION['user']['id'] . "'");</p><p> }</p><p> }</p><p></p><p>?></p><p> </form>[/CODE]</p><p></p><p>Any help appreciated and thanks in advance</p></blockquote><p></p>
[QUOTE="Ben144, post: 467721, member: 73963"] Hey, I have created a simple settings page for the FluxRP Emulator ect and I have added an option for when a player click on the relevant button, then it will either disable or enable friend requests ect, but it is not working as when i add the php code, then the cms just breaks and when i remove the code, then the button doesn't work at all. [CODE]<div class="content-box"> <div class="title">Friend Requests</div> <div class="box-content d-flex justify-content-center align-items-center"> <?php if (isset($_POST['profileForm'])) { $efr = filter($_POST['friendRequestsAllowed']); if ($efr == 1) { echo '<div class="ml-3 mr-auto">You currently have friend requests <b>Disabled</b></div>' mysql_query("UPDATE users SET block_newfriends = '0' WHERE id = '" . $_SESSION['user']['id'] . "'"); } else if ($efr == 0) { echo '<div class="ml-3 mr-auto">You currently have friend requests <b>Enabled</b></div>' mysql_query("UPDATE users SET block_newfriends = '1' WHERE id = '" . $_SESSION['user']['id'] . "'"); } } ?> <div class="mr-3"> <form method="post" id="profileForm" class="form-block"> <input type="hidden" name="_token" value="4e26eaf44aedd954ff26441a92b2b42bbe4d1ada"> <input type="hidden" name="block_friend_requests" value="" value="true"> <?php if (isset($_POST['profileForm'])) { $efr = filter($_POST['friendRequestsAllowed']); if ($efr == 1) { echo '<button type="submit" name="friendRequestsAllowed" class="button green">Disable</button>' mysql_query("UPDATE users SET block_newfriends = '0' WHERE id = '" . $_SESSION['user']['id'] . "'"); } else if ($efr == 0) { echo '<button type="submit" name="friendRequestsAllowed" class="button green">Enabled</button>' mysql_query("UPDATE users SET block_newfriends = '1' WHERE id = '" . $_SESSION['user']['id'] . "'"); } } ?> </form>[/CODE] Any help appreciated and thanks in advance [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
How to enable and disable friend requests (Help Please)
Top