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 |
#42
|
|||
|
|||
Good deal!
And just to finalize my questions...how would I implement this for multiple forums? Any chance we could get an admin option panel in the admincp for this? |
#43
|
||||
|
||||
If you are going to only use this on a few forums, you could do this:
HTML Code:
<if condition="in_array($forumid, array(30, 31, 32))"> $forumdisplayquickstats </if> |
#44
|
|||
|
|||
Thanks for the tip.
What I meant was that I'd like to see this as an option in vBulletin settings, where I could modify what forums receive this versus modifying a conditional. You said if there are only a few forums....how much load would the array hammer on the system? Can you define a few....like less than five or less than 20? |
#45
|
||||
|
||||
The array sholdn't do any more than if you did
HTML Code:
<if condition="$forumid == '30' OR $forumid == '31' OR $forumid == '32'">
|
#46
|
||||
|
||||
Boofo !
[high]* Zachariah "click" [/high] BTW: your forums mouse is cool almost Star Trek |
#47
|
||||
|
||||
Thank you, sir. And my mouse thanks you.
Did you check out my Forum Quick Stats setup on my site? I re-did the template so it has a cleaner look to it. Check it out and let me know what you think. |
#48
|
|||
|
|||
Ahh bofo, i was just thinking about making something like this.. just saved me hours of work ...
thanks dude.. |
#49
|
||||
|
||||
No problem.
And it's Boofo, with 2 o's. |
#50
|
|||
|
|||
Error
SQL-query : INSERT INTO " . TABLE_PREFIX . "datastore( title, DATA ) VALUES ( 'forumstatscache', 'a:15:{ s:10:"numthreads";s:1:"0"; s:10:"numreplies";s:1:"0"; s:8:"numviews";s:1:"0"; s:15:"topthreadscount";s:1:"0"; s:12:"topthreadsid";s:1:"0"; s:12:"topthreadsun";s:0:""; s:17:"topthreadspercent";s:1:"0"; s:14:"toppostercount";s:1:"0"; s:11:"topposterid";s:1:"0"; s:11:"topposterun";s:0:""; s:16:"topposterpercent";s:1:"0"; s:12:"attachscount";s:1:"0"; s:12:"attachsbytes";s:1:"0"; s:9:"avgrating";s:1:"0"; s:10:"lastupdate";s:1:"0"; }' ) MySQL said: #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '" . TABLE_PREFIX . "datastore( title, DATA ) VALUES ( 'forum |
#51
|
|||
|
|||
false alarm, works fine without the query
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|