Kathy
11-25-2002, 09:56 PM
Okay, not sure how to describe this...nor how to fix it. :banana:
I have several special hacks on my board that were installed by various helpers from here and vb.com.
This particular hack has been no problem for any upgrade. With this upgrade there is apparently something that messing up in the script.
We have special usergroups. While the registered users are "regular members" these special usergroups (we call jewels) are levels of donors.
Crown Jewels
Rubies
Diamonds
Each of these groups get special privileges. Avatars for one.
All of their group specialites seem to be working.
However here is where the glitch comes in:
We have a hack that is a page the displays these crown jewels. It is a hack that KIER wrote for displaying mod groups back before this function was added to the VB)
CLick on this link and it takes you to a page that is based on templates, a crown.php file .....
I have the link to view these JEWELS in every header of the VB and on my content pages.
However since the upgrade last week, whenever anyone clicks on the link, we are getting an error:
Database error in vBulletin 2.2.8:
Invalid SQL:
SELECT DISTINCT
user.*, userfield.*, session.userid AS sessionuserid, session.lastactivity
,avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
FROM user
LEFT JOIN usergroup ON (usergroup.usergroupid = user.usergroupid)
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.usergroupid IN(50,51,34)
GROUP BY user.username
ORDER BY user.userid
mysql error:
mysql error number: 0
Date: Monday 25th of November 2002 05:42:02 PM
Script: http://www.hystersisters.com/vb2/vb2/crown.php
Referer: http://www.hystersisters.com/vb2/forumdisplay.php?s=&forumid=5
The odd thing...is that the link is:
http://www.hystersisters.com/vb2/crown.php in all the headers (I didn't accidently put vb2 in their twice.)
while the error shows /vb2/vb2/
Remembering I'm PHP-challenged, is there someplace I can check to find this error?
I'm attaching the crown.php file for you to see:
<?
// install show admin groups version 2.0
// by Kier Darby: kier@ap3d.com
$supermod_usergroup = 51;
$admin_usergroup = 50;
$mentor_usergroup = 34;
// set the next line to "no" if you don't want to show avatars.
$showavatars = "no";
$templatesused="postbit_online,postbit_offline,showmoderators,show mods_adminbit,postbit_sendpm,showmods_bit,showmods _forumbit,showmods_forumsplit,postbit_avatar";
require ("./global.php");
function douserinfo() {
global $user, $sendpmlink, $onlinestatus, $showonline, $cookietimeout, $showavatars, $avatarenabled;
$datecut = time() - $cookietimeout;
if ($user[field2] == "") $user[location] = " ";
else $user[location] = $user[field2];
if ($user[receivepm] == 0) $sendpmlink = " ";
else {
$post[userid] = $user[userid];
eval("\$sendpmlink = \"".gettemplate("postbit_sendpm")."\";");
}
if ($showonline)
if ($user[sessionuserid]>0 && $user[lastactivity]>$datecut) eval("\$onlinestatus = \"".gettemplate("postbit_online")."\";");
else eval("\$onlinestatus = \"".gettemplate("postbit_offline")."\";");
else
$onlinestatus = " ";
if ($showavatars == "yes") {
if ($user[avatarid]!=0) {
$avatarurl=$user[avatarpath];
} else {
if ($user[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?s=$session[sessionhash]&userid=$user[userid]";
} else {
$avatarurl="";
}
}
if ($avatarurl=="") {
$user[avatar]="";
} else {
eval("\$user[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
}
}
// get administrators & super moderators ************************************************** ********
$users = $DB_site->query("
SELECT DISTINCT
user.*, userfield.*, session.userid AS sessionuserid, session.lastactivity
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar","")."
FROM user
LEFT JOIN usergroup ON (usergroup.usergroupid = user.usergroupid)
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid","")."
WHERE user.usergroupid IN($admin_usergroup,$supermod_usergroup,$mentor_us ergroup)
GROUP BY user.username
ORDER BY user.userid
");
while ($user = $DB_site->fetch_array($users)) {
if ($user[usergroupid] == $admin_usergroup) {
if (($admincount++ % 2) == 0) $backcolor = "#DFDFDF";
else $backcolor = "#F1F1F1";
douserinfo();
eval("\$adminbits .= \"".gettemplate("showmods_adminbit")."\";");
}
elseif ($user[usergroupid] == $supermod_usergroup) {
if (($smodcount++ % 2) == 0) $backcolor = "#DFDFDF";
else $backcolor = "#F1F1F1";
douserinfo();
eval("\$supermodbits .= \"".gettemplate("showmods_adminbit")."\";");
}
else {
if (($mentorcount++ % 2) == 0) $backcolor = "#DFDFDF";
else $backcolor = "#F1F1F1";
douserinfo();
eval("\$mentorbits .= \"".gettemplate("showmods_adminbit")."\";");
}
}
// get moderators ************************************************** ********
$users = $DB_site->query("
SELECT DISTINCT
user.*, userfield.*, forum.forumid, forum.title AS forumtitle, session.userid AS sessionuserid
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar","")."
FROM moderator
LEFT JOIN user ON (user.userid = moderator.userid)
LEFT JOIN forum ON (forum.forumid = moderator.forumid)
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid","")."
ORDER BY user.username ASC, forum.displayorder ASC
");
while ($user = $DB_site->fetch_array($users)) {
$moderator[$user[userid]] = $user;
if ($modforums[$user[userid]] == "")
eval("\$modforums[".$user[userid]."] .= \"".gettemplate("showmods_forumbit")."\";");
else {
eval("\$modforums[".$user[userid]."] .= \"".gettemplate("showmods_forumsplit")."\";");
eval("\$modforums[".$user[userid]."] .= \"".gettemplate("showmods_forumbit")."\";");
}
}
unset($user);
while(list(, $user) = each($moderator)) {
if (($modcount++ % 2) == 0) $backcolor = "#DFDFDF";
else $backcolor = "#F1F1F1";
$forumbits = $modforums[$user[userid]];
douserinfo();
eval("\$moderatorbits .= \"".gettemplate("showmods_bit")."\";");
}
// ************************************************** *****
makeforumjump();
eval("dooutput(\"".gettemplate("showmoderators")."\");");
?>
Thanks for any help you can provide.
:ermm:
I have several special hacks on my board that were installed by various helpers from here and vb.com.
This particular hack has been no problem for any upgrade. With this upgrade there is apparently something that messing up in the script.
We have special usergroups. While the registered users are "regular members" these special usergroups (we call jewels) are levels of donors.
Crown Jewels
Rubies
Diamonds
Each of these groups get special privileges. Avatars for one.
All of their group specialites seem to be working.
However here is where the glitch comes in:
We have a hack that is a page the displays these crown jewels. It is a hack that KIER wrote for displaying mod groups back before this function was added to the VB)
CLick on this link and it takes you to a page that is based on templates, a crown.php file .....
I have the link to view these JEWELS in every header of the VB and on my content pages.
However since the upgrade last week, whenever anyone clicks on the link, we are getting an error:
Database error in vBulletin 2.2.8:
Invalid SQL:
SELECT DISTINCT
user.*, userfield.*, session.userid AS sessionuserid, session.lastactivity
,avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar
FROM user
LEFT JOIN usergroup ON (usergroup.usergroupid = user.usergroupid)
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid
WHERE user.usergroupid IN(50,51,34)
GROUP BY user.username
ORDER BY user.userid
mysql error:
mysql error number: 0
Date: Monday 25th of November 2002 05:42:02 PM
Script: http://www.hystersisters.com/vb2/vb2/crown.php
Referer: http://www.hystersisters.com/vb2/forumdisplay.php?s=&forumid=5
The odd thing...is that the link is:
http://www.hystersisters.com/vb2/crown.php in all the headers (I didn't accidently put vb2 in their twice.)
while the error shows /vb2/vb2/
Remembering I'm PHP-challenged, is there someplace I can check to find this error?
I'm attaching the crown.php file for you to see:
<?
// install show admin groups version 2.0
// by Kier Darby: kier@ap3d.com
$supermod_usergroup = 51;
$admin_usergroup = 50;
$mentor_usergroup = 34;
// set the next line to "no" if you don't want to show avatars.
$showavatars = "no";
$templatesused="postbit_online,postbit_offline,showmoderators,show mods_adminbit,postbit_sendpm,showmods_bit,showmods _forumbit,showmods_forumsplit,postbit_avatar";
require ("./global.php");
function douserinfo() {
global $user, $sendpmlink, $onlinestatus, $showonline, $cookietimeout, $showavatars, $avatarenabled;
$datecut = time() - $cookietimeout;
if ($user[field2] == "") $user[location] = " ";
else $user[location] = $user[field2];
if ($user[receivepm] == 0) $sendpmlink = " ";
else {
$post[userid] = $user[userid];
eval("\$sendpmlink = \"".gettemplate("postbit_sendpm")."\";");
}
if ($showonline)
if ($user[sessionuserid]>0 && $user[lastactivity]>$datecut) eval("\$onlinestatus = \"".gettemplate("postbit_online")."\";");
else eval("\$onlinestatus = \"".gettemplate("postbit_offline")."\";");
else
$onlinestatus = " ";
if ($showavatars == "yes") {
if ($user[avatarid]!=0) {
$avatarurl=$user[avatarpath];
} else {
if ($user[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?s=$session[sessionhash]&userid=$user[userid]";
} else {
$avatarurl="";
}
}
if ($avatarurl=="") {
$user[avatar]="";
} else {
eval("\$user[avatar] = \"".gettemplate("postbit_avatar")."\";");
}
}
}
// get administrators & super moderators ************************************************** ********
$users = $DB_site->query("
SELECT DISTINCT
user.*, userfield.*, session.userid AS sessionuserid, session.lastactivity
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar","")."
FROM user
LEFT JOIN usergroup ON (usergroup.usergroupid = user.usergroupid)
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid","")."
WHERE user.usergroupid IN($admin_usergroup,$supermod_usergroup,$mentor_us ergroup)
GROUP BY user.username
ORDER BY user.userid
");
while ($user = $DB_site->fetch_array($users)) {
if ($user[usergroupid] == $admin_usergroup) {
if (($admincount++ % 2) == 0) $backcolor = "#DFDFDF";
else $backcolor = "#F1F1F1";
douserinfo();
eval("\$adminbits .= \"".gettemplate("showmods_adminbit")."\";");
}
elseif ($user[usergroupid] == $supermod_usergroup) {
if (($smodcount++ % 2) == 0) $backcolor = "#DFDFDF";
else $backcolor = "#F1F1F1";
douserinfo();
eval("\$supermodbits .= \"".gettemplate("showmods_adminbit")."\";");
}
else {
if (($mentorcount++ % 2) == 0) $backcolor = "#DFDFDF";
else $backcolor = "#F1F1F1";
douserinfo();
eval("\$mentorbits .= \"".gettemplate("showmods_adminbit")."\";");
}
}
// get moderators ************************************************** ********
$users = $DB_site->query("
SELECT DISTINCT
user.*, userfield.*, forum.forumid, forum.title AS forumtitle, session.userid AS sessionuserid
".iif($avatarenabled,",avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar","")."
FROM moderator
LEFT JOIN user ON (user.userid = moderator.userid)
LEFT JOIN forum ON (forum.forumid = moderator.forumid)
LEFT JOIN userfield ON (userfield.userid = user.userid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
".iif ($avatarenabled,"LEFT JOIN avatar ON avatar.avatarid=user.avatarid LEFT JOIN customavatar ON customavatar.userid=user.userid","")."
ORDER BY user.username ASC, forum.displayorder ASC
");
while ($user = $DB_site->fetch_array($users)) {
$moderator[$user[userid]] = $user;
if ($modforums[$user[userid]] == "")
eval("\$modforums[".$user[userid]."] .= \"".gettemplate("showmods_forumbit")."\";");
else {
eval("\$modforums[".$user[userid]."] .= \"".gettemplate("showmods_forumsplit")."\";");
eval("\$modforums[".$user[userid]."] .= \"".gettemplate("showmods_forumbit")."\";");
}
}
unset($user);
while(list(, $user) = each($moderator)) {
if (($modcount++ % 2) == 0) $backcolor = "#DFDFDF";
else $backcolor = "#F1F1F1";
$forumbits = $modforums[$user[userid]];
douserinfo();
eval("\$moderatorbits .= \"".gettemplate("showmods_bit")."\";");
}
// ************************************************** *****
makeforumjump();
eval("dooutput(\"".gettemplate("showmoderators")."\");");
?>
Thanks for any help you can provide.
:ermm: