vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vB3 Forumhome Stats Cache Serialize hack v2.2 (https://vborg.vbsupport.ru/showthread.php?t=61420)

Alex 03-25-2004 02:39 AM

Ah, got it.... nice one. So that means, there will be a version 3.0? :D

BTW, while I am browsing your forums. Which "Who was online today"-Hack do you use? I like it with keeping the most ever users online today.
Next one I would be very interested in is the XXX's Private Forum. Is that just done by using the [you] hack, or is there anything else to it?

Boofo 03-25-2004 03:58 AM

Just the [you] hack is all. It works very well in the forums as you can see. Although, I changed [you] to my own special word so the hack does not get abused and used wrongly on my crappy site. ;)

bobjackson 03-25-2004 11:48 AM

a quick note on the install...

everything went fine except the "Top Referrer" query.

i have a table prefix set, so i had to alter your query. :)
(added "TABLE_PREFIX" on the select list AND the where clause for the "user" table).

Code:

// <!-- TOP REFERRER -->
        $ref = $DB_site->query_first("
                SELECT COUNT(*) AS referrals, " . TABLE_PREFIX . "user.username, " . TABLE_PREFIX . "user.userid
                FROM " . TABLE_PREFIX . "user AS users
                LEFT JOIN " . TABLE_PREFIX . "user ON (users.referrerid = " . TABLE_PREFIX . "user.userid)
                WHERE users.referrerid <> 0
                GROUP BY users.referrerid
                ORDER BY referrals DESC
                LIMIT 1
        ");

otherwise...installed fine. :) thanks.

Boofo 03-25-2004 11:57 AM

You should have only had to add the TABLE_PREFIX on the tables themselves, not the SELECT parts. ;)

But as long as it is installed and working for you, then great! Make sure you make the changes noted above until I get the update for this hack out, though. ;)

bobjackson 03-25-2004 12:18 PM

Quote:

Originally Posted by Boofo
You should have only had to add the TABLE_PREFIX on the tables themselves, not the SELECT parts. ;)

But as long as it is installed and working for you, then great! Make sure you make the changes noted above until I get the update for this hack out, though. ;)

well no...as that obviouslly didn't work for me. ;)

"TABLE_PREFIX . user" is seen as a different table than just "user".

it's like saying:
"SELECT A.fieldname FROM tablename B"

A.fieldname does NOT exist in tablename B

in your current sql statement, you're specifying a table that *may not* exist for some members...the "user" table. :)

regardless, i have it installed and i'm good to go!
i only posted that because i saw that another person had this same error. :)

thanks again!

Boofo 03-25-2004 08:09 PM

Quote:

in your current sql statement, you're specifying a table that *may not* exist for some members...the "user" table.
If anyone running vBulletin doesn't have a user table, that would definately be a first and impossible, also, I'm afraid. ;)

bobjackson 03-25-2004 11:06 PM

Quote:

Originally Posted by Boofo
If anyone running vBulletin doesn't have a user table, that would definately be a first and impossible, also, I'm afraid. ;)

sorry...my post came out wrong.

of course they'd have a user table.

i was trying to point out that they may not have it named [user]; as i run my tables with a prefix. :)

Boofo 03-25-2004 11:08 PM

Right, and the TABLE_PREFIX in front of the user table should take care of that. ;)

bobjackson 03-25-2004 11:17 PM

do me a favor...take two minutes and create a new user table with a prefix, then run your query below (replacing TABLE_PREFIX below with the prefix on the newly created table).

it will error out.
#1109 - Unknown table 'user' in field list

merely putting the table prefix in the "from" clause only is not enough.

your query:
// <!-- TOP REFERRER -->
$ref = $DB_site->query_first("
SELECT COUNT(*) AS referrals, user.username, user.userid
FROM " . TABLE_PREFIX . "user AS users
LEFT JOIN " . TABLE_PREFIX . "user ON (users.referrerid = user.userid)
WHERE users.referrerid <> 0
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT 1
");


i don't get me wrong here, i'm not trying to give you a hard time. just want to point out that the above string is incorrect when using a table prefix. :)

Boofo 03-25-2004 11:32 PM

I'll take your word for it since I don't use a table prefix in my db. It's just that that isn't supposed to be how it works from all I've encountered with vB3. If it is doing what you say, then it sounds to me like the vb team needs to do some more work on the TABLE_PREFIX code, don't you think? ;)


All times are GMT. The time now is 12:23 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.01535 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete