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
RevCMS Ban Function
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="Detox" data-source="post: 426545" data-attributes="member: 596"><p>Hey Dev Again,</p><p>I've been editing RevCMS for Arcturus... But because of the banning function is different than what it used to be, I'm trying to re-code it.</p><p></p><p>class.user.php</p><p>[PHP]final public function isBanned($type)</p><p> {</p><p> global $engine;</p><p> if($engine->num_rows("SELECT * FROM bans WHERE type = '" . $type . "' LIMIT 1") > 0)</p><p> {</p><p> if($engine->num_rows("SELECT * FROM bans WHERE ip = '" . $type . "' LIMIT 1") > 0)</p><p> {</p><p> return true;</p><p> }</p><p> }</p><p> </p><p> return false;</p><p> }[/PHP]</p><p></p><p>checktheban.php</p><p>[PHP]<?php</p><p></p><p>if($_SESSION['user']['id']){</p><p></p><p>$getuserinfo = mysql_query("SELECT * FROM users WHERE id='".$_SESSION['user']['id']."'");</p><p>while($row = mysql_fetch_array($getuserinfo))</p><p>{</p><p>$usernameban = $row['user_id'];</p><p>$ipban = $row['ip'];</p><p></p><p>}</p><p></p><p>$getuserinfo= mysql_query("SELECT * FROM bans WHERE user_id='{$usernameban}' AND ban_expire > UNIX_TIMESTAMP() ORDER BY ban_expire DESC LIMIT 1");</p><p>$getuserinfoip= mysql_query("SELECT * FROM bans WHERE ip='{$ipban}' AND ban_expire > UNIX_TIMESTAMP() ORDER BY ban_expire DESC LIMIT 1");</p><p></p><p>while($row = mysql_fetch_array($getuserinfo))</p><p>{</p><p></p><p>$expire = $row['ban_expire'];</p><p></p><p> if($expire <= time()){</p><p> </p><p> }</p><p> else</p><p> {</p><p>header('Location: /banned');</p><p>exit;</p><p> }</p><p> }</p><p></p><p> while($row = mysql_fetch_array($getuserinfoip)){</p><p></p><p>$expire = $row['ban_expire'];</p><p></p><p> if($expire <= time()){</p><p> </p><p> }</p><p> else</p><p> {</p><p>header('Location: /ipbanned');</p><p>exit;</p><p> }</p><p> }</p><p> }</p><p> </p><p>?>[/PHP]</p><p></p><p>Arcturus Ban Structure. </p><p><img src="http://i68.tinypic.com/11c9v11.jpg" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </p><p>Please I need assistance.</p></blockquote><p></p>
[QUOTE="Detox, post: 426545, member: 596"] Hey Dev Again, I've been editing RevCMS for Arcturus... But because of the banning function is different than what it used to be, I'm trying to re-code it. class.user.php [PHP]final public function isBanned($type) { global $engine; if($engine->num_rows("SELECT * FROM bans WHERE type = '" . $type . "' LIMIT 1") > 0) { if($engine->num_rows("SELECT * FROM bans WHERE ip = '" . $type . "' LIMIT 1") > 0) { return true; } } return false; }[/PHP] checktheban.php [PHP]<?php if($_SESSION['user']['id']){ $getuserinfo = mysql_query("SELECT * FROM users WHERE id='".$_SESSION['user']['id']."'"); while($row = mysql_fetch_array($getuserinfo)) { $usernameban = $row['user_id']; $ipban = $row['ip']; } $getuserinfo= mysql_query("SELECT * FROM bans WHERE user_id='{$usernameban}' AND ban_expire > UNIX_TIMESTAMP() ORDER BY ban_expire DESC LIMIT 1"); $getuserinfoip= mysql_query("SELECT * FROM bans WHERE ip='{$ipban}' AND ban_expire > UNIX_TIMESTAMP() ORDER BY ban_expire DESC LIMIT 1"); while($row = mysql_fetch_array($getuserinfo)) { $expire = $row['ban_expire']; if($expire <= time()){ } else { header('Location: /banned'); exit; } } while($row = mysql_fetch_array($getuserinfoip)){ $expire = $row['ban_expire']; if($expire <= time()){ } else { header('Location: /ipbanned'); exit; } } } ?>[/PHP] Arcturus Ban Structure. [IMG]http://i68.tinypic.com/11c9v11.jpg[/IMG] Please I need assistance. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
RevCMS Ban Function
Top