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)

wrongful 03-23-2004 10:50 PM

I seem to be having some major problems with this hack.

First, the total registrations count is more than double what my actual registrations are. Also, how are active members calculated as opposed to people who are a part of the total registrations, and can this be modified. Also, my top referer isn't showing up as you can see in this screenshot. I am using vB3 Gold if that makes any difference.

Alex 03-23-2004 10:51 PM

Ok, here is the piece of code
Code:

// <!-- TOP POSTER -->
        $topposter = $DB_site->query_first("
                SELECT username,posts,userid
                FROM " . TABLE_PREFIX . "user
                ORDER BY posts
                DESC LIMIT 1
        ");

        // <!-- TOP THREAD STARTER -->
        $topstarter=$DB_site->query_first("
                SELECT COUNT(*) AS count,postuserid,postusername
                FROM " . TABLE_PREFIX . "thread
                GROUP BY postuserid
                ORDER BY count
                DESC LIMIT 1
        ");

At least I think it is...

BTW, I tried to set my lanuage to english but even though, the link to the members profile is still wrong. The link doesn't show up like:
www.forum.url/forum/member.php?u=3512
it shows like:
www.forum.url/forum/member.php?u=3,512 (<-- see the comma?)

When I turn it back to german, I have a dot there instead of the comma, which is the german separator for a thousand.

This also happens with topposter, Most Viewed Profile and Top Referrer. With the welcome newest member it is fine. In both languages.

Boofo 03-23-2004 11:27 PM

Ok, change this query:

PHP Code:

    // <!-- TOP THREAD STARTER -->
    
$topstarter=$DB_site->query_first("
        SELECT COUNT(*) AS count,postuserid,postusername
        FROM " 
TABLE_PREFIX "thread
        GROUP BY postuserid
        ORDER BY count
        DESC LIMIT 1
    "
); 

to this:

PHP Code:

    // <!-- TOP THREAD STARTER -->
    
$topstarter=$DB_site->query_first("
            SELECT COUNT(*) AS count,postuserid,postusername
            FROM " 
TABLE_PREFIX "thread
            WHERE postuserid <> 0
            GROUP BY postuserid
            ORDER BY count
            DESC LIMIT 1
        "
); 

As far as the uderids going to an error page, delete the following from the index.php:

PHP Code:

    $statscache['topposterid'] = vb_number_format($statscache['topposterid']);
    
$statscache['topstartid'] = vb_number_format($statscache['topstartid']);
    
$statscache['getfileviewsid'] = vb_number_format($statscache['getfileviewsid']);
    
$statscache['topreferrerid'] = vb_number_format($statscache['topreferrerid']);
    
$statscache['toprepid'] = vb_number_format($statscache['toprepid']); 

I forgot to take that code out when I released the hack. Sorry about that. That should fix everything. Let me know for sure.

Boofo 03-23-2004 11:35 PM

Quote:

Originally Posted by wrongful
I seem to be having some major problems with this hack.

First, the total registrations count is more than double what my actual registrations are. Also, how are active members calculated as opposed to people who are a part of the total registrations, and can this be modified. Also, my top referer isn't showing up as you can see in this screenshot. I am using vB3 Gold if that makes any difference.

Support is only being provided to those who click the install button. That is something that is being ignored on this site and needs to be taken care of by anyone who installs the hacks made here. I hope you can understand.

wrongful 03-23-2004 11:39 PM

Quote:

Originally Posted by Boofo
Support is only being provided to those who click the install button. That is something that is being ignored on this site and needs to be taken care of by anyone who installs the hacks made here. I hope you can understand.

Ok I didn't click it initially because it wasn't working right and I normally don't click install until I have a hack completely working, but if you insist.

Boofo 03-23-2004 11:54 PM

Thank you. ;)

Ok, the Total Registrations are the total regsitrations you have EVER had on your board. When you delete accounts for whatever reason, the Active Registrations are what is left. That is the ACTUAL number of memebers on your site. Does that make any sense. ;)

As far as the userids not being correct, follow the instructions above and delete those lines and when the next cache update is run, it should straighten everything out for the userids.

Also, make sure you have the referrer sysem enabled in the Admin CP. If it is, then you missed a piece of code when installing the hack. Look at the spot where the name should be in the code and tell me what is there right now.

Alex 03-24-2004 12:01 AM

Quote:

Originally Posted by Boofo
Ok, change this query:

PHP Code:

    // <!-- TOP THREAD STARTER -->
    
$topstarter=$DB_site->query_first("
        SELECT COUNT(*) AS count,postuserid,postusername
        FROM " 
TABLE_PREFIX "thread
        GROUP BY postuserid
        ORDER BY count
        DESC LIMIT 1
    "
); 

to this:

PHP Code:

    // <!-- TOP THREAD STARTER -->
    
$topstarter=$DB_site->query_first("
            SELECT COUNT(*) AS count,postuserid,postusername
            FROM " 
TABLE_PREFIX "thread
            WHERE postuserid <> 0
            GROUP BY postuserid
            ORDER BY count
            DESC LIMIT 1
        "
); 

As far as the uderids going to an error page, delete the following from the index.php:

PHP Code:

    $statscache['topposterid'] = vb_number_format($statscache['topposterid']);
    
$statscache['topstartid'] = vb_number_format($statscache['topstartid']);
    
$statscache['getfileviewsid'] = vb_number_format($statscache['getfileviewsid']);
    
$statscache['topreferrerid'] = vb_number_format($statscache['topreferrerid']);
    
$statscache['toprepid'] = vb_number_format($statscache['toprepid']); 

I forgot to take that code out when I released the hack. Sorry about that. That should fix everything. Let me know for sure.

Now I get this:
Code:

Database error in vBulletin 3.0.0:

Invalid SQL: 
        SELECT COUNT(*) AS count,postuserid,postusername
        FROM thread
        WHERE usergroupid IN (2,5,6,7)
        GROUP BY postuserid
        ORDER BY count
        DESC LIMIT 1
   
mysql error: Unknown column 'usergroupid' in 'where clause'

mysql error number: 1054

Date: Wednesday 24th of March 2004 03:03:48 AM
Script: http://www.spassforen.de/forum/index.php?
Username: Alex
IP Address: xxx.xxx.xxx.xxx


Boofo 03-24-2004 12:04 AM

Ok, redo the code with the query from the post above again (you will notice it is different now). I had to change it and you had already re-done it before the post edit. Sorry about that. ;)

Alex 03-24-2004 12:07 AM

Quote:

Originally Posted by Boofo
Ok, redo the code with the query from the post above again (you will notice it is different now). I had to change it and you had already re-done it before the post edit. Sorry about that. ;)

lol... ok, mom ;)

Alex 03-24-2004 12:10 AM

Now we're talking. Thanx dude! :) Oh, and if you have a minute, phrasing all that stuff into the vB's Phrase System would be nice. I do that one now on my own.

Thanks again! :)


All times are GMT. The time now is 10:51 AM.

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.01691 seconds
  • Memory Usage 1,776KB
  • 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
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (4)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