- Joined
- Jun 27, 2009
- Messages
- 1,571
- Reaction score
- 170
Hey Y'all...
I'm back working on CMS feature for RevCMS and trying to improve it... So like I'm trying to get the ban function to work on the CMS so when I ban the user it will direct them to banned page.
Now I understand about editing the class.users.php which I have done, but idk if it proper coding for the function.
I bet I'm going to have to place "}" or "{" somewhere guarantee, I have placed around with me but getting syntax error. Unexpected } but everything seem to match.
Now here is the checktheban.php
Can someone please tell me what is going on??
I'm back working on CMS feature for RevCMS and trying to improve it... So like I'm trying to get the ban function to work on the CMS so when I ban the user it will direct them to banned page.
Now I understand about editing the class.users.php which I have done, but idk if it proper coding for the function.
PHP:
final public function isBanned($value)
{
global $engine;
if($engine->num_rows("SELECT * FROM bans WHERE type = '" . $value . "' LIMIT 1") > 0)
if($engine->num_rows("SELECT * FROM bans WHERE ip = '" . $value . "' LIMIT 1") > 0)
{
return true;
}
return false;
}
I bet I'm going to have to place "}" or "{" somewhere guarantee, I have placed around with me but getting syntax error. Unexpected } but everything seem to match.
Now here is the 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 expire DESC LIMIT 1");
$getuserinfoip= mysql_query("SELECT * FROM bans WHERE ip='{$ipban}' AND ban_expire > UNIX_TIMESTAMP() ORDER BY 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;
}
}
}
?>
Can someone please tell me what is going on??