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)

Boofo 03-26-2004 01:41 AM

Read my message above your last message. ;)

[high]* Boofo ducks![/high]

Mijae 03-26-2004 01:49 AM

Quote:

Originally Posted by Boofo
Read my message above your last message. ;)

[high]* Boofo ducks![/high]

Seems to work now, but...

Quote:

Top Poster: Raziel Darkeyes (1,646 Posts = 8,230%)
Top Thread Starter: Raziel Darkeyes (153 Threads = 15,300%)
Some users can get mistaken by that, not sure if its ment to show the last 3 decimals or it thinks that 153 threads out of 1200 is 15300% :P

Boofo 03-26-2004 01:59 AM

Woah! that shouldn't be doing that. It works fine on my site. Set up a test account so I can log on and see the full stats.

Mijae 03-26-2004 02:05 AM

User: Test Dummy
Pass: test

Boofo 03-26-2004 02:18 AM

I'm not sure what is going on with the percentages on your site. I am going to have to look at it further and figure out what to do. The code should work for bigger numbers the same as it does for smaller numbers.

You can go ahead and take out the code for percentages for now if you want until I can figure it out. It doesn't make sense why it isn't working, though. Apparently, the threads and posts being that big of a number must make the percentage code do something wierd.

I'll let you know when I have something for you to test (since my baord is so small). ;)

Mijae 03-26-2004 02:23 AM

No problem, its still an excellent hack :D

It sure got my vote for HoTM :P

Boofo 03-26-2004 02:25 AM

Thank you, sir. ;)

And I WILL figure out what is going on and supply a fix for it, somehow. ;)

apokphp 03-26-2004 02:27 AM

What about excluding certain members from being in the stats? For example...I own the site, as such, I have significantly more posts and other stats, than my members. I prefer this to be something more for my members, and I wish to be excluded from showing up in the stats. How can I do that?

Boofo 03-26-2004 02:38 AM

Quote:

Originally Posted by apokphp
What about excluding certain members from being in the stats? For example...I own the site, as such, I have significantly more posts and other stats, than my members. I prefer this to be something more for my members, and I wish to be excluded from showing up in the stats. How can I do that?

I do the same thing on my site. ;)

Let me know what stats you want to be excluded from and I can give you the code to do it. ;)

apokphp 03-26-2004 02:53 AM

I don't get it. It removed the Who's Online area instead of the old stats area. Also, I get funky decimal percentages, and the name of the community doesn't appear. Just using the default, unhacked FORUMHOME template, the code you say to replace, does not exist. It is similar, but it is not exact.


You can login to see what I'm talking about here:

www.onlinedebate.net/forums/

User: llama
pass: llama

Also, as far as excluding members...isn't there a way to go by userid? I'd just prefer to remove myself AND my forumbot from all possible stats.

Boofo 03-26-2004 03:06 AM

Ok, show me the default code for that area and I will see what I can do to fix it for you. I was using the code from RC3 so it may be different in vB 3 Gold.

Tne percentages seem to have problems with larger thread counts than I have on my board, for some reason. Take the percentage code out for now until I can figure out a way to fix it.

Do you want to excluded from ALL stats or just certain ones?

apokphp 03-26-2004 03:19 AM

Ahhh...that's gotta be it. I assumed this was for vb3 GOLD.

Here is the code:

PHP Code:

<!-- logged-in users -->
<
tbody>
    <
tr>
        <
td class="thead" colspan="2">
            <
a style="float:$stylevar[right]href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a>
            <
a href="online.php?$session[sessionurl]">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
        </
td>
    </
tr>
</
tbody>
<
tbody id="collapseobj_forumhome_activeusers" style="$vbcollapse[collapseobj_forumhome_activeusers]">
    <
tr>
        <
td class="alt2"><a href="online.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="$vbphrase[view_whos_online]border="0" /></a></td>
        <
td class="alt1" width="100%">
            <
div class="smallfont">
                <
div style="white-space: nowrap"><phrase 1="$recordusers2="$recorddate3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase></div>
                <
div>$activeusers</div>
            </
div>
        </
td>
    </
tr>
</
tbody>
<!-- 
end logged-in users -->
</if>
<
tbody>
    <
tr>
        <
td class="thead" colspan="2">
            <
a style="float:$stylevar[right]href="#top" onclick="return toggle_collapse('forumhome_stats')"><img id="collapseimg_forumhome_stats" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_stats].gif" alt="" border="0" /></a>
            <
phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>
        </
td>
    </
tr>
</
tbody>
<
tbody id="collapseobj_forumhome_stats" style="$vbcollapse[collapseobj_forumhome_stats]">
    <
tr>
        <
td class="alt2"><img src="$stylevar[imgdir_misc]/stats.gif" alt="<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>" border="0" /></td>
        <
td class="alt1">
        <
div class="smallfont">
            <
div>$vbphrase[threads]: $totalthreads$vbphrase[posts]: $totalposts$vbphrase[members]: $numbermembers</div>
            <
div><phrase 1="member.php?$session[sessionurl]u=$newuserid2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
        </
div>
        </
td>
    </
tr>
</
tbody


Boofo 03-26-2004 03:29 AM

I had it right. You just accidentally replaced too much code. Replace this part of it with the stats hack:

HTML Code:

<tbody>
    <tr>
        <td class="thead" colspan="2">
            <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_stats')"><img id="collapseimg_forumhome_stats" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_stats].gif" alt="" border="0" /></a>
            <phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>
        </td>
    </tr>
</tbody>
<tbody id="collapseobj_forumhome_stats" style="$vbcollapse[collapseobj_forumhome_stats]">
    <tr>
        <td class="alt2"><img src="$stylevar[imgdir_misc]/stats.gif" alt="<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>" border="0" /></td>
        <td class="alt1">
        <div class="smallfont">
            <div>$vbphrase[threads]: $totalthreads, $vbphrase[posts]: $totalposts, $vbphrase[members]: $numbermembers</div>
            <div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
        </div>
        </td>
    </tr>
</tbody>


apokphp 03-26-2004 03:49 AM

That's what I DID replace. I gave you code before this part on purpose (I didn't replace all of that). I provided the additional "What's going on" part of the code.

Boofo 03-26-2004 03:57 AM

Well, as you can see, this hack doesn't touch the Who's Online code at all, so you must have replaced too much of the code. ;)

Put the template back at the default (or the way it was BEFORE you installed this hack) and try it again with just the code replaced from above. See if that fixes your problem. Let me know.

apokphp 03-26-2004 03:58 AM

ok, I think I fixed that. ;)

What about excluding users from the stats?

Boofo 03-26-2004 03:59 AM

Ok, how did you fix it? Do I need to change the instructions again?

Also, like I said above, I need to know which stats you want to be excluded from.

apokphp 03-26-2004 04:12 AM

How about these:

Top Poster
Top Thread Starter
Top Reputation

As far as fixing...I don't know...it was a copy/paste job. I reset to default, used an html editer so I could compare code, did what I thought I had done in the template system...but it seemed to be correct this time around.

I didn't change any code.

Boofo 03-26-2004 04:26 AM

Top thread starter, use this instead of the query in the hack:

PHP Code:

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

Top Poster, do the same thing with this:

PHP Code:

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

Top reputation, again, do the replace it with:

PHP Code:

    // <!-- TOP REPUTATION -->
    
$toprep $DB_site->query_first("
            SELECT userid, username, reputation
            FROM " 
TABLE_PREFIX "user
            WHERE userid NOT IN (1)
            ORDER BY reputation
            DESC LIMIT 1
        "
); 

If you want to add more userids, just put a comma after the 1 in the code abaove and the userid you want to exclude, like this:

NOT IN (1,2,3,4,5)

;)

apokphp 03-26-2004 04:32 AM

k, thanks. I'm waiting for it to update...we'll see if it worked. ;)

Also, what about the Title of the block? It says: "%1$s Statistics "

Boofo 03-26-2004 04:55 AM

Change this:

HTML Code:

$vbphrase[x_statistics]
To this:

HTML Code:

<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>
for the title. ;)

Owen 03-26-2004 11:01 AM

Top Poster: Owen (4,782 Posts = 8,389.47%)
Top Thread Starter: SSJ3 Goten (214 Threads = 7,133.33%)

Those percentages are a bit too precise for my taste, How do I limit it to 2 decimals?
(http://vxforums.com)

Boofo 03-26-2004 11:05 AM

LOL I'm working on that. I haven't figured out how to do it yet. I will post it here the second I have it. Until then, just take out the percentage code in the template. ;)

Owen 03-26-2004 11:15 AM

nah, I'll just leave it, as long as I know it will be fixed. So I can tell my members that...

Boofo 03-26-2004 11:18 AM

I'll get it fixed, somehow, or die trying, anyway. ;)

Owen 03-26-2004 11:23 AM

What dedication! Thats the spirit!

Boofo 03-26-2004 11:25 AM

LOL I haven't ever had a piece of code beat me yet and I ain't about to let that happen now! ;)

Owen 03-26-2004 03:04 PM

There have been 33,184 visits to this page since January 1st, 2003.

Could you possibly release that as a hack or addon to this?

Boofo 03-26-2004 03:45 PM

That's a page counter that I've had (seems like) forever. I could probably add the code for that fairly easily. Once I get the percentages code figured out, I will look into getting that added for you. How does that sound, sir? ;)

Owen 03-26-2004 04:01 PM

Sounds great, I am a stats freak, in case you didnt figure that out yet ;)

Boofo 03-26-2004 04:14 PM

Did you check out my forumdisplay stats hack yet?

Also, you DID vote this hack for hack of the month for March, right? ;)

apokphp 03-26-2004 05:11 PM

Do you guys get anything out of having your hack be the "hack of the month"? I never understood this.

Also, your change fixed the forum name error. ty ;)

Owen 03-26-2004 09:05 PM

Quote:

Originally Posted by Boofo
Did you check out my forumdisplay stats hack yet?

Also, you DID vote this hack for hack of the month for March, right? ;)

Wow that forumdisplay thing is cool, I installed it the moment I layed eyes on it.

As for hack of the month, its quite the achievement if out of all the hacks yours gets picked for hack of the month.

lasto 03-26-2004 09:21 PM

a lot of queries though aint it - won tit bring the forum to a halt this ?

Boofo 03-26-2004 11:50 PM

No, because the queries aren't hard on the server and they are quick. ;)

Boofo 03-27-2004 01:02 AM

Quote:

Originally Posted by apokphp
Do you guys get anything out of having your hack be the "hack of the month"? I never understood this.

Also, your change fixed the forum name error. ty ;)

Not really. It's just a nice recognition for hackers that says "Job well done" and that others appreciate his/her work. ;)

Boofo 03-27-2004 01:05 AM

Quote:

Originally Posted by Owen
Wow that forumdisplay thing is cool, I installed it the moment I layed eyes on it.

As for hack of the month, its quite the achievement if out of all the hacks yours gets picked for hack of the month.

I just released an update to the Forumdisplay Stats hack where the template now matches the one for this hack. ;)

Well, yes and no. Usually it is a real honor to be voted hack of the month but since vB3 Gold just came out, there aren't as many hacks in the running right now so there isn't a lot to choose from. But it would still be nice to win. ;)

Mijae 03-27-2004 03:54 AM

Quote:

Originally Posted by Boofo
I just released an update to the Forumdisplay Stats hack where the template now matches the one for this hack. ;)

Well, yes and no. Usually it is a real honor to be voted hack of the month but since vB3 Gold just came out, there aren't as many hacks in the running right now so there isn't a lot to choose from. But it would still be nice to win. ;)

I found a small typo :P

Instead of "since your list visit" it should say "since your last visit" :P

Boofo 03-27-2004 04:02 AM

I'll fix that, thank you for spotting it. ;)

Boofo 03-27-2004 08:53 AM

I think we have come up with a fix for the percentage problem, but I need to have someone test it that has a large board. Try this and let me know if it fixes this one percentage. If it does, I will post the rest of the fix for this.

In Index.php

Find:

PHP Code:

$statscache['topthreadspercent'] = round(100 * ($topstarter[count] / $totalthreads), 2); 

and replace it with:

PHP Code:

$statscache['topthreadspercent'] = sprintf("%.2f",(100*$topstarter[count] / $totalthreads)); 

Find:

PHP Code:

    if (($statscache['topthreadspercent'] % 10) == 0)
        
$statscache['topthreadspercent'] = vb_number_format($statscache['topthreadspercent']) . '%';
    else
        
$statscache['topthreadspercent'] = vb_number_format($statscache['topthreadspercent'], 2) . '%'

and replace it with:

PHP Code:

$statscache['topthreadspercent'] = vb_number_format($statscache['topthreadspercent'], 2) . '%'

Let me know how it goes. ;)


All times are GMT. The time now is 06:12 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.01716 seconds
  • Memory Usage 1,889KB
  • 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
  • (3)bbcode_html_printable
  • (8)bbcode_php_printable
  • (7)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