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? ;)

bobjackson 03-25-2004 11:51 PM

na, actually that's SQL thing...nothing to do with vB. ;)

when joining tables, you should specify the TABLE_PREFIX on the table AND field names.
if pulling only ONE table, you do not need the TABLE_PREFIX on the select list, just the table name.

thanks for listening! :D




and GREAT hack btw!

Boofo 03-26-2004 12:06 AM

I'll have to remember that in the future. Thank you, sir, for informing me of this. It's good to know. ;)

Don't forget to vote for the Hack of the Month for March. This hack is in there. ;)

Mijae 03-26-2004 12:13 AM

Quote:

Originally Posted by Boofo
I'll have to remember that in the future. Thank you, sir, for informing me of this. It's good to know. ;)

Don't forget to vote for the Hack of the Month for March. This hack is in there. ;)

Seems like I am the only one who is having style problems? I have a default vB3 template, but the style is messed up!

Check it out at http://www.invoid.net

[high]* Mijae clicks install after posting.[/high]

Boofo 03-26-2004 12:24 AM

Try changing this:

HTML Code:

<td colspan="6" nowrap="nowrap"><span class="smallfont">$vbphrase[threads]:
to this:

HTML Code:

<td colspan="6" nowrap="nowrap" colspan="2"><span class="smallfont">$vbphrase[threads]:
and let me know if it fixes it.

Mijae 03-26-2004 12:25 AM

Quote:

Originally Posted by Mijae
Seems like I am the only one who is having style problems? I have a default vB3 template, but the style is messed up!

Check it out at http://www.invoid.net

[high]* Mijae clicks install after posting.[/high]

Also, %'s arent showing up! Hrm!

Boofo 03-26-2004 12:26 AM

This is what I see:

ivForums Statistics

Mijae 03-26-2004 12:27 AM

Quote:

Originally Posted by Boofo
Try changing this:

HTML Code:

<td colspan="6" nowrap="nowrap"><span class="smallfont">$vbphrase[threads]:
to this:

HTML Code:

<td colspan="6" nowrap="nowrap" colspan="2"><span class="smallfont">$vbphrase[threads]:
and let me know if it fixes it.

Didn't fix it.

Mijae 03-26-2004 12:29 AM

Here is a SS of what I see:

Boofo 03-26-2004 12:29 AM

Ok, try this then:

Change:

HTML Code:

<td class="panelsurround" align="center">
to:

HTML Code:

<td class="panelsurround" align="center" colspan="2">

Boofo 03-26-2004 12:31 AM

Hang in there, we'll get it. ;)

Mijae 03-26-2004 12:31 AM

Ok, that fixed the table but it made the image go away :P That doesnt matter tho...

I still see no % and there are some numbers with no text next to them, I am not sure what it should say there? Its in the screenshot.

Boofo 03-26-2004 12:36 AM

Ok, I intentionally did this so there was no image on the left as the box is long and an image at the top obn the left didn't look right to me. I have all my boxes down there with no images on my site. ;)

Set the update time to 0 and run it a few times and see if that fills those percent areas. Let me know, ok?

Boofo 03-26-2004 12:39 AM

Also, change that last code I gave you to this and let me know if it still looks ok.

HTML Code:

<td class="panelsurround" align="center" colspan="6">
And don't forget to change back the first code I gave you that didn't work. ;)

Mijae 03-26-2004 12:40 AM

Quote:

Originally Posted by Boofo
Ok, I intentionally did this so there was no image on the left as the box is long and an image at the top obn the left didn't look right to me. I have all my boxes down there with no images on my site. ;)

Set the update time to 0 and run it a few times and see if that fills those percent areas. Let me know, ok?

Did that, still nothing.

There is no text for Thread Views:, etc. There wasn't anything in the instructions to add phrases, not sure if thats the problem.

Boofo 03-26-2004 12:42 AM

I don't have the phrase system set up for this yet. All of that is hardcoded. I'll look at it now and get it going for you until I can get the phrase system in place. Ok?

Mijae 03-26-2004 12:47 AM

Quote:

Originally Posted by Boofo
I don't have the phrase system set up for this yet. All of that is hardcoded. I'll look at it now and get it going for you until I can get the phrase system in place. Ok?

I re-edited index.php and re-added the template changes and still nothing, no % and no text.

My index.php is unhacked :P

Mijae 03-26-2004 12:50 AM

$vbphrase[bf2_thread_views]:

Stuff like that isnt showing up :P

Erwin 03-26-2004 12:53 AM

Very cool hack, Boofo. :)

Mijae 03-26-2004 01:02 AM

Also, the welcome latest member won't show up!

Damn, your hack messed all my stats :P My forum didnt seem to like the hack altho I did :P

Boofo 03-26-2004 01:06 AM

Ok, relax. I just uploaded a fixed version to the first post. Clear your cache and re-download it and it should fix ALL of your problems. Let me know. I will stay with you until it is working 100%. That's all I can do except apologize for not looking closer at the file I uploaded the first time. I'm sorry for all the troubles. ;)

Boofo 03-26-2004 01:08 AM

Quote:

Originally Posted by Erwin
Very cool hack, Boofo. :)

Thank you, my friend. Coming from you, that means alot to me. After all, I learned alot of coding from you and your hacks. ;)

I just had to re-upload the file because I uploaded the wrong one earlier. It was missing some stuff. Oops! ;)

apokphp 03-26-2004 01:15 AM

Anyway to exclude members from stats?

Also, it's not working on my site. It's vb3 Gold...no modification to the forumhome template other than yours. Why is it screwy like dat? ;)

Boofo 03-26-2004 01:16 AM

I'm not sure what you mean.

Mijae 03-26-2004 01:18 AM

Ha! I knew I had to add some phrases! Wow, I actually saw something wrong :P I have no php knowlegde, so its a big thing for me :P

Everything seems right now, except that the % shows up as 0% for everything.

Also,
PHP Code:

$statscache unserialize($datastore['statscache']); 

Do I have to add that to my phpinclude_start if I only use these stats on forumhome?

Edit: also, not sure if its just me or not, but I can't logout now, everytime I click logout and get back to forum index, I am logged in.

Boofo 03-26-2004 01:21 AM

Quote:

Originally Posted by apokphp
Anyway to exclude members from stats?

Also, it's not working on my site. It's vb3 Gold...no modification to the forumhome template other than yours. Why is it screwy like dat? ;)

Clear your cache and re-download the file from the first post. I uploaded the wrong one earlier. Sorry about that. ;)

Boofo 03-26-2004 01:24 AM

Quote:

Originally Posted by Mijae
Ha! I knew I had to add some phrases! Wow, I actually saw something wrong :P I have no php knowlegde, so its a big thing for me :P

Everything seems right now, except that the % shows up as 0% for everything.

Also,
PHP Code:

$statscache unserialize($datastore['statscache']); 

Do I have to add that to my phpinclude_start if I only use these stats on forumhome?

Edit: also, not sure if its just me or not, but I can't logout now, everytime I click logout and get back to forum index, I am logged in.

No, you do not add that for the foumhome. That is only if you want the stats to show up on another page and not have to run any queries. An added bonus, I guess you could say.

The logging out has nothing to do with this hack. Try clearing your cookies and see if that fixes your logging out problem.

Is everything running right or do we need to fix something else?

Mijae 03-26-2004 01:26 AM

Quote:

Originally Posted by Boofo
No, you do not add that for the foumhome. That is only if you want the stats to show up on another page and not have to run any queries. An added bonus, I guess you could say.

The logging out has nothing to do with this hack. Try clearing your cookies and see if that fixes your logging out problem.

Is everything running right or do we need to fix something else?

Everything is working fine, except percentages show up as 0%.

My top poster has ~1600 posts and it says 1600 = 0%.

Boofo 03-26-2004 01:27 AM

Did you set the updatetime to 0 and run it a few times? Try that and let me know. We WILL get it working for you. ;)

Boofo 03-26-2004 01:33 AM

Ok, I found the problem. I'm a dolt! ;)

Last time, I swear. ;) Re-download the file from the first post (clear your cache first) and re-do the code for the index.php. The percents should show now. ;)

Mijae 03-26-2004 01:38 AM

Quote:

Originally Posted by Boofo
Did you set the updatetime to 0 and run it a few times? Try that and let me know. We WILL get it working for you. ;)

Yep, I set it to 0 and tried a few times to see if it fixed, but nope :P

I also updated counters and stuff like that, didn't help.


All times are GMT. The time now is 10:58 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.01860 seconds
  • Memory Usage 1,840KB
  • 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
  • (7)bbcode_html_printable
  • (2)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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