The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
vB3 Forum Quick Stats Cache Serialize Hack v1.1 Details »» | |||||||||||||||||||||||||||
vB3 Forum Quick Stats Cache Serialize Hack v1.1
Developer Last Online: Jun 2012
vB3 Forum Quick Stats Cache Serialize Hack
Version 1.1 (By Boofo) What does this hack do? It will display stats about each forum at the top of that forum. (NOTE: The attachments info will NOT show in forums that have no attachments.) Also included in the hack is Logician's vB2 "Last Post Minute Hack" (with his permission for the vB2 version, of course) optimized and redone for vB3. It now uses NO queries to get the last minute info. This hack will display a link the last post and the time the last post was made (i.e. "1 minute" or "2 days", etc.) as well as the name and link to the last poster in the forum. The stats are cached and the cache is only updated at a time set by you. With an option in the Admin CP, you can reset the time between cache updates without having to edit any more files once this hack is installed. This hack will add 1 optimized query (for the user's threads and replies stats) on a cache read, but since this hack is serialized, the cache read itself will not pull a query. On a cache update, it will add 6 queries to update the datastore. And then drop back down to the one query until the next cache update. This hack will make a cache in the datastore for each forum you have, so you don't have to worry about forums getting cross-cached with this hack. It has been thorughly tested on my site, but as we all know too well, sites can, and often do, vary in the way a hack performs on it. I forsee no problems of any kind on any site in the way this hack functions. It's basically pretty simple and hard to mess up. Note: This is the setting for the time interval (in minutes) that you want the cache to be updated on. The default value is 10 minutes. The following code is in the forumdisplay.php part of this hack. $updatetime = 10; Once you install the Admin CP setting (at the end of this file), you will be able to update this from the Admin CP vBulletin Options settings. Credits: A BIG thank you goes out to KirbyDE for all of his guidance and patience while this hack was being written and tested. This hack might never have gotten past the dreamed up state if it wasn't for him. And it definately wouldn't have been finished by now or turned out as optimized as it is. Thank you, my friend. I learned a lot from you on our little adventure here. It was definately worth the trip. Version Information: Version 1.0 --Initial release Version 1.1 --Corrected a few minor potential bugs and re-did the template. Now it has a cleaner look. Installation overview: Files to edit: (1) --forumdisplay.php Templates to add: (1) --forumdisplay_quickstats Templates to edit: (1) --forumdisplay Settings to add: (1) --forumcachetime Note: The first image below will show the forum quick stats for a forum that has attachments. The second image will show the forum quick stats for a forum that has no attachments. Show Your Support
|
Comments |
#52
|
||||
|
||||
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.
|
#53
|
||||
|
||||
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&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&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 /> |
#54
|
||||
|
||||
Can we see a screenshot, please?
|
#55
|
||||
|
||||
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. |
#56
|
||||
|
||||
If the user is unregistered, it should tell them they have made no posts in that forum.
Quote:
|
#57
|
||||
|
||||
Quote:
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> |
#58
|
||||
|
||||
You need to change this:
PHP Code:
PHP Code:
|
#59
|
||||
|
||||
nope it counts it as guests having a userid of 0
|
#60
|
||||
|
||||
Quote:
[high]* Boofo ducks and hides [/high] Guests have NO userid and there isn't such a thing as a userid 0. |
#61
|
||||
|
||||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|