Parse error: parse error, unexpected T_STRING in /home/fhlinux199/k/kroozing.com/user/htdocs/forum/modcp/banning.php on line 279
I get that error message when I open banning.php . "View Banned Users" link under "Users" menu in Admin CP.
Any ideas?
I've checked the instructions and it seems like I've copied it correctly :s
Here is what my file looks like, in that area. Compare it with yours.
PHP Code:
// there is already a record - just update this record
$DB_site->query("
UPDATE " . TABLE_PREFIX . "userban SET
adminid = $bbuserinfo[userid],
bandate = " . TIMENOW . ",
liftdate = $liftdate,
reason = '" . addslashes($reason) . "'
WHERE userid = $user[userid] ");
}
else
{
// insert a record into the userban table
$DB_site->query("
INSERT INTO " . TABLE_PREFIX . "userban
(userid, usergroupid, displaygroupid, customtitle, usertitle, adminid, bandate, liftdate, reason)
VALUES
($user[userid], $user[usergroupid], $user[displaygroupid], $user[customtitle], '" . addslashes($user['usertitle']) . "', $bbuserinfo[userid], " . TIMENOW . ", $liftdate, '" . addslashes($reason) . "')
");
}
// update the user record
$DB_site->query("
UPDATE " . TABLE_PREFIX . "user SET
$bantitlesql usergroupid = $usergroupid,
displaygroupid = 0
WHERE userid = $user[userid] ");
I don't have any TABLE_PREFIX's in my db, how do I update my code so it it doesn't read TABLE_PREFIX in the banning.php file?
Thanks
Quote:
Originally Posted by sv1cec
Here is what my file looks like, in that area. Compare it with yours.
PHP Code:
// there is already a record - just update this record $DB_site->query(" UPDATE " . TABLE_PREFIX . "userban SET adminid = $bbuserinfo[userid], bandate = " . TIMENOW . ", liftdate = $liftdate, reason = '" . addslashes($reason) . "' WHERE userid = $user[userid] "); } else { // insert a record into the userban table $DB_site->query(" INSERT INTO " . TABLE_PREFIX . "userban (userid, usergroupid, displaygroupid, customtitle, usertitle, adminid, bandate, liftdate, reason) VALUES ($user[userid], $user[usergroupid], $user[displaygroupid], $user[customtitle], '" . addslashes($user['usertitle']) . "', $bbuserinfo[userid], " . TIMENOW . ", $liftdate, '" . addslashes($reason) . "') "); }
// update the user record $DB_site->query(" UPDATE " . TABLE_PREFIX . "user SET $bantitlesql usergroupid = $usergroupid, displaygroupid = 0 WHERE userid = $user[userid] ");
Actually, you do not have to delete anything, since the part you indicate is something that vB knows, and is replaced during execution, automatically.
It's one thing to replace that, when running a query externally, and another thing to edit the files and remove that. You do not have to remove that part, your vB should work fine as it is. If you have to remove it for your vB to work, something is wrong.
Well before making the change, when I tried accessing "ban a user" in the modcp, I got an error on line 260 of the banning.php file????? I removed the " . TABLE_PREFIX . " portion that line and the error went away??? Anyways, it appears that it is working now?
Yes, but I am sure that if you look in the file, you will find plenty of other instances where that particular piece of code is used. It's in every query that is run by the program. So it can't cause an error in one particular line and not cause the error in all the other lines. Unless of course, something is wrong with that line, somewhere else.