PDA

View Full Version : Problem with the Away Hack


Chase
07-15-2002, 01:07 AM
I am getting these errors on my forum:

This when I try to use my Admin Options:

"The action you have attempted could not be performed as your session appears to be invalid. Click the below link to attempt this action again with a new session."

And this in the Admin CP:

When I try to find a user in the CP

"There seems to have been a slight problem with the [M]adness Forum database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

And then in a text box below:

Database error in vBulletin Control Panel 2.2.5:

Invalid SQL: SELECT *,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,FROM_UNIXTIME(awaydate) AS awaydate avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
FROM user
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.userid=12
mysql error: You have an error in your SQL syntax near 'avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
' at line 1

mysql error number: 1064

Date: Sunday 14th of July 2002 08:16:12 PM
Script: http://www.madnessforum.com/vb/vb/a...=edit&userid=12
Referer: http://madnessforum.com/vb/admin/?"



Why am I getting these errors? How can it be fixed?

Scrub
07-15-2002, 03:07 AM
I fixed this somehow. Let me post my query for ya. :).

Here is the unedited code:

$user=$DB_site->query_first("SELECT user.*,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,
avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
FROM user
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.userid=$userid");


And replace that with:


$user=$DB_site->query_first("SELECT user.*,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,FROM_UNIXTIME(awaydate) AS awaydate,
avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
FROM user
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.userid=$userid");

Chase
07-15-2002, 03:26 AM
Can you tell me again where the section is

Scrub
07-15-2002, 03:32 AM
Doing a search for:

$user=$DB_site->query_first("SELECT

would be alot faster. :).

But in my hacked user.php, this is where it is:


// ###################### Start edit #######################
if ($action=="edit") {

$user=$DB_site->query_first("SELECT user.*,FROM_UNIXTIME(joindate) AS joindate,FROM_UNIXTIME(lastvisit) AS lastvisit,FROM_UNIXTIME(lastactivity) AS lastactivity,FROM_UNIXTIME(lastpost) AS lastpost,FROM_UNIXTIME(awaydate) AS awaydate,
avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
FROM user
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.userid=$userid");

if ($user[coppauser]==1) {
echo "<P><b>THIS IS A COPPA USER. DO NOT CHANGE TO USERGROUP TO REGISTERED USER UNLESS YOU HAVE RECEIVED PARENTAL CONSENT</b></p>";
}