Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
database error....for a hack... Details »»
database error....for a hack...
Version: , by Kathy Kathy is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 11-25-2002 Last Update: Never Installs: 0
 
No support by the author.

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:
Quote:
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/for...p?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:

Code:
<?

// 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,showmods_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] = "&nbsp;";
else $user[location] = $user[field2];

if ($user[receivepm] == 0) $sendpmlink = "&nbsp;";
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 = "&nbsp;";

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_usergroup)
  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:

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-25-2002, 10:09 PM
Kathy's Avatar
Kathy Kathy is offline
 
Join Date: Nov 2001
Location: Texas, ya'll
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another error:

Quote:
Database error in vBulletin 2.2.8:

Invalid SQL:
SELECT DISTINCT privatemessage.*, user.username AS tousername, user.emailonpm, user.invisible,
user.lastactivity, icon.iconpath, session.userid AS sessionuserid
FROM privatemessage
LEFT JOIN user ON (user.userid = privatemessage.touserid)
LEFT JOIN icon ON (icon.iconid = privatemessage.iconid)
LEFT JOIN session ON (session.userid = user.userid
AND session.userid <> 0 AND user.invisible = 0 AND session.lastactivity>0)
WHERE fromuserid=27814
AND folderid <> -1
AND receipt > 0
AND dateline >= 1038092807
ORDER BY dateline DESC
mysql error:

mysql error number: 0

Date: Monday 25th of November 2002 06:06:47 PM
Script: http://www.hystersisters.com/vb2/vb2...php?daysprune=
Referer: http://www.hystersisters.com/vb2/private.php
Now its other things as well....

Any idea why the path is adding an extra vb2/ to the path??
Reply With Quote
  #3  
Old 11-25-2002, 10:40 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check in the Admin CP that $bburl (the boards url) is set correctly and that you don't have the directory name twice there.
Reply With Quote
  #4  
Old 11-25-2002, 10:42 PM
Kathy's Avatar
Kathy Kathy is offline
 
Join Date: Nov 2001
Location: Texas, ya'll
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I checked and I don't. All other functions are fine. Replies and threads, forums and so on....

I'm putting in a ticket at VB.com I guess....
Reply With Quote
  #5  
Old 11-26-2002, 01:34 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The repeating forum directory is just a by-product of the SQL error - ignore that.

The problem is the query - I had a similar problem in my admin user.php and mod user.php - it is to with the query looking for non-custom avatars. For the life of me I cannot remember what I did to fix it...

It's to do with newer versions of vB not liking certain older queries. That doesn't explain your private.php error though, unless you didn't update it completely.

When I have time I will look it up for you.
Reply With Quote
  #6  
Old 11-26-2002, 01:41 AM
Kathy's Avatar
Kathy Kathy is offline
 
Join Date: Nov 2001
Location: Texas, ya'll
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks guys. Just an update...I found the culprit. Not VB at all....but a too full server. /usr was so full it couldn't handle even writing correct error logs (thus the error=0 in the error message)

My server holds 16 gig and yet we had it at capacity with the vb of ours. Its not the first time a full server did funky things to the processes of the vb...and each time I forget about this kind of behavior. (Each time its a bit different in its symptoms)

We recently upgraded and had additional backups of the database...somewhere between 1-2 gig in size.

So...we deleted two backups and *poof* we are in business again and my hacks are all functional again and the other postings.php and private2.php are now working fine.

Thanks sooo much for ya'lls help. (And thanks to Logician who found my server tooooo full as the answer)


Any idea if adding a hard drive to my server would help with storage space on a rapidly growing database? :-) (I even prune inactive members monthly.)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04071 seconds
  • Memory Usage 2,265KB
  • Queries Executed 19 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete