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 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 "


All times are GMT. The time now is 06:29 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.01372 seconds
  • Memory Usage 1,794KB
  • 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_html_printable
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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