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 Forum Quick Stats Cache Serialize Hack v1.1 (https://vborg.vbsupport.ru/showthread.php?t=61581)

Boofo 03-26-2004 11:31 PM

Yeah, I found out after coding this that you don't even really need to run the query to make the table. It will make itself when you first run the hack. KirbyDE pointed that out to me when I was writing this hack. ;)

sabret00the 03-31-2004 10:17 PM

prefered the old layout but oh well, heres an improved "forumdisplay_quickstats" template

HTML Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tbody>
<tr>
        <td class="tcat"><strong>
                <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumstats')"><img id="collapseimg_forumstats" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumstats].gif" alt="" border="0" /></a>
                $foruminfo[title] Statistics</strong>
        </td>
</tr>
</tbody>
<tbody id="collapseobj_forumstats" style="$vbcollapse[collapseobj_forumstats]">
<tr>
        <td class="panelsurround" align="center">

        <table class="panel" cellpadding="0" cellspacing="$stylevar[formspacer]" border="0" width="100%">
        <tr>
                <td align="$stylevar[left]">
                        <fieldset class="fieldset" style="margin:0px">
                                <legend>$statsupdate</legend>
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                                <tr>
                                        <td colspan="2" nowrap="nowrap"><div class="smallfont">Total Number Of Threads: <strong>$forumstats[numthreads]</strong></div></td>
                                </tr>
                                <tr>
                                        <td nowrap="nowrap"><span class="smallfont"><a href="$vboptions[bburl]/showthread.php?$session[sessionurl]goto=newpost&amp;t=$lastthreadid">Lastpost</a>: <strong>$lastpostmin </strong></span></td>
                                </tr>
                                <tr>
                                        <td nowrap="nowrap"><span class="smallfont">Top Threads: <a href="member.php?$session[sessionurl]u=$forumstats[topthreadsid]" target="_blank">$forumstats[topthreadsun]</a> (<strong>$forumstats[topthreadscount]</strong> Threads = <strong>$forumstats[topthreadspercent]</strong>)</span></td>
                                        </tr>
                                        <if condition="$forumstats[attachscount] !='0'">
                                <tr>
                                        <td nowrap="nowrap"><span class="smallfont">Total Attachments: <strong>$forumstats[attachscount]</strong> ($forumstats[attachsthumbs] - $forumstats[attachsfiles])</span></td>
                                </tr>
                                        </if>
                                <tr>
                                        <td nowrap="nowrap"><span class="smallfont">Average Thread Rating: <img class="inlineimg" src="$stylevar[imgdir_rating]/rating_$forumstats[avgrating].gif" alt="some text"></span></td>
                                </tr>
                                </table>
                        </fieldset>
                </td>
                <td align="$stylevar[left]">
                        <fieldset class="fieldset" style="margin:0px">
                                <legend>$statsupdate</legend>
                                <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                                <tr>
                                        <td colspan="2" nowrap="nowrap"><span class="smallfont">Total Number Of Replies: <strong>$forumstats[numreplies]</strong></span></td>
                                </tr>
                                <tr>
                                        <td nowrap="nowrap"><span class="smallfont">Last Poster: <a href="member.php?$session[sessionurl]find=lastposter&amp;f=$forumid" target="_blank">$lastposter</a></span></td>
                                </tr>
                                <tr>
                                        <td nowrap="nowrap"><span class="smallfont">Top Posts: <a href="member.php?$session[sessionurl]u=$forumstats[topposterid]" target=_blank>$forumstats[topposterun]</a> (<strong>$forumstats[toppostercount]</strong> Posts = <strong>$forumstats[topposterpercent]</strong>)</span></td>
                                </tr>
                                        <if condition="$forumstats[attachscount] !='0'">
                                <tr>
                                        <td nowrap="nowrap"><span class="smallfont">Total Attachments Bytes: <strong>$forumstats[attachsbytes]</strong></span></td>
                                </tr>
                                        </if>
                                <tr>
                                        <td nowrap="nowrap"><span class="smallfont">Total Thread Views: <strong>$forumstats[numviews]</strong></span></td>
                                </tr>
                                </table>
                        </fieldset>
                </td>
        </tr>
        </table>
<tr>
<if condition="$bbuserinfo[userid] > 0">
<if condition="$yourposts != 0">
        <td class="thead" align="center" nowrap="nowrap" colspan="2"><if condition="$forumstats[topposterun] == $bbuserinfo[username]"><strong>$bbuserinfo[username], you're this forum's <i>Top Poster</i> with a total of $yourposts</strong>. (<strong>$yourthreads and $yourreplies</strong>)<else /><strong>$bbuserinfo[username], you have made a total of $yourposts in this forum</strong>. (<strong>$yourthreads and $yourreplies</strong>)</if></td>
<else />
        <td class="thead" align="center" nowrap="nowrap" colspan="2"><strong>$bbuserinfo[username], you have not yet posted in this forum</strong>.</td>
</if>
<else />
        <td class="thead" align="center" colspan="2"><phrase 1="faq.php?$session[sessionurl]" 2="register.php?$session[sessionurl]">$vbphrase[first_visit_message]</phrase></td>

</if>
</tr>
</tbody>
</table>
<br />


Boofo 04-01-2004 02:53 AM

Can we see a screenshot, please? ;)

sabret00the 04-01-2004 07:12 AM

ok :)

basically it just removed the colour hardcoding and shows guests the welcome message instead of "unregistered you have 169 posts and 20 threads"

also changed the header to use tcat and the bottom to use tfoot for a cleaner look.

Boofo 04-01-2004 07:29 AM

If the user is unregistered, it should tell them they have made no posts in that forum.

Quote:

Unregistered, you have not yet posted in this forum.
Do you allow guests to post?

sabret00the 04-01-2004 08:52 AM

Quote:

Originally Posted by Boofo
If the user is unregistered, it should tell them they have made no posts in that forum.



Do you allow guests to post?

nope i don't but occasionally users get pruned and their posts remain so theirs something like 500 unregistered/guest posts, but with the conditional i managed to get rid of that

HTML Code:

<if condition="$bbuserinfo[userid] > 0">
<if condition="$yourposts != 0">
        <td class="thead" align="center" nowrap="nowrap" colspan="2"><if condition="$forumstats[topposterun] == $bbuserinfo[username]"><strong>$bbuserinfo[username], you're this forum's <i>Top Poster</i> with a total of $yourposts</strong>. (<strong>$yourthreads and $yourreplies</strong>)<else /><strong>$bbuserinfo[username], you have made a total of $yourposts in this forum</strong>. (<strong>$yourthreads and $yourreplies</strong>)</if></td>
<else />
        <td class="thead" align="center" nowrap="nowrap" colspan="2"><strong>$bbuserinfo[username], you have not yet posted in this forum</strong>.</td>
</if>
<else />
        <td class="thead" align="center" colspan="2"><phrase 1="faq.php?$session[sessionurl]" 2="register.php?$session[sessionurl]">$vbphrase[first_visit_message]</phrase></td>

</if>

so it displays seperate messages dependant on your userid being above zero

Boofo 04-01-2004 09:45 AM

You need to change this:

PHP Code:

<if condition="$bbuserinfo[userid] > 0"

to this:

PHP Code:

<if condition="$bbuserinfo[userid]"

since guests don't have a userid of any kind. ;)

sabret00the 04-01-2004 09:52 AM

nope it counts it as guests having a userid of 0

Boofo 04-01-2004 10:02 AM

Quote:

Originally Posted by sabret00the
nope it counts it as guests having a userid of 0

I'm sorry, big fella, but you are wrong on this one. ;)

[high]* Boofo ducks and hides
[/high]

Guests have NO userid and there isn't such a thing as a userid 0.

sabret00the 04-01-2004 10:24 AM

Quote:

Originally Posted by Boofo
I'm sorry, big fella, but you are wrong on this one. ;)

[high]* Boofo ducks and hides
[/high]

Guests have NO userid and there isn't such a thing as a userid 0.

probably but it works, where as before it was showing unrigistered you have XXX posts and XXX threads


All times are GMT. The time now is 09:38 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.01199 seconds
  • Memory Usage 1,797KB
  • 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_html_printable
  • (2)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)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