PDA

View Full Version : Forum Quick Stats v1.0


Boofo
05-18-2003, 10:00 PM
Forum Quick Stats v1.0
(By Boofo)

Thanks goes out to Mug and cirisme, for all of their indispensable help with the queries. Without them, this hack would still be on the drawing board. And thanks also goes out to Grog6 for the basis of this hack, which is his Forums Statistics hack. A special thanks goes out to Logician for his great Last Post Minute Hack. Thank you, my friend. ;)

This hack has all new 100% working (and optimized) queries. I will be updating it to cache all of the queries so it will only update them at a pre-determined time (set by you).

What this hack does:
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 "Last Post Minute Hack" (with his permission, of course). 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.).

Tested and installed on vBulletin v2.2.9 (but should work with all versions).

Files to edit: 1 (forumdisplay.php)
Template to edit: 1 (forumdisplay)
Templates to add: 2 (lastpostminute and forumdisplay_quickstats)
Settings to edit: 1 (in the Admin CP)
Install time: 5 minutes (if you are slow or a newbie ;))

Please click the install button if you install this hack. (I have 3 kids to put through college.)

Dan
05-19-2003, 08:52 PM
Screenshot?

Boofo
05-19-2003, 09:01 PM
Here is a screenshot with the attachment info.

Boofo
05-19-2003, 09:02 PM
Here is a screenshot without the attachment info.

Reverend
05-19-2003, 10:02 PM
Looks good Boofo.
Will replace grog's hack with this one.I'll install tomorrow on v2.3.0 ;)

Boofo
05-19-2003, 10:26 PM
Today at 06:02 PM Reverend said this in Post #5 (https://vborg.vbsupport.ru/showthread.php?postid=397409#post397409)
Looks good Boofo.
Will replace grog's hack with this one.I'll install tomorrow on v2.3.0 ;)

Thanks. ;)

Don't forget to click install. I plan on updating it to cache the queries and you can be automatically notified when I do the update.

Dan
05-19-2003, 10:32 PM
Hmm.... might install this once I'm finished playing around with my new half life cds

kaotic
05-19-2003, 11:03 PM
Looks good. I'll download it once it is updated.

*Installed for now.

grog6
05-19-2003, 11:21 PM
Thx for the (big) release, good work Boofo ;)
And a big thanks too for all updates and support you brang in my thread whereas I couldn't do it by myself

I still have a lot of work for the university ... I'm working now on a PHP/SQL project, so I'll improve my PHP and so will come soon for big, usefull and "good coded hack" :D

;)

Boofo
05-19-2003, 11:28 PM
Thank you for the kind words. Your hack was very useful in putting this together. I learned some things along the way, plus I had some great help with this. ;)

I'll look forward to your next hack. ;)

Reverend
05-19-2003, 11:39 PM
Now installed on vb 2.3.0.
Works perfect.
One question,how do i change the font color for "$yourstats"

i tried editing the forumdisplay.php code from this:

<smallfont><b>$bbuserinfo[username], you have made a total of <i>$yourposts</i> posts in this forum.</b></smallfont>

to this:

<smallfontcolor="#FFFFFF"><b>$bbuserinfo[username], you have made a total of <i>$yourposts</i> posts in this forum.</b></smallfont>

but get parse errors.

Boofo
05-19-2003, 11:41 PM
Change this:

<smallfontcolor="#FFFFFF"><b>$bbuserinfo[username], you have made a total of <i>$yourposts</i> posts in this forum.</b></smallfont>

to this:

<smallfontcolor=\"#FFFFFF\"><b>$bbuserinfo[username], you have made a total of <i>$yourposts</i> posts in this forum.</b></smallfont>

You have to put backslashes before the quotes in php files. ;)

Reverend
05-19-2003, 11:47 PM
That did it.
Thanks Boofo. ;)

Boofo
05-19-2003, 11:53 PM
No problem. Enjoy! ;)

Reverend
05-19-2003, 11:54 PM
Just wondering if its possible to edit the font colour for $yourstats via the forumdisplay_quickstats template so that the colour can be set for different styles.

squawell
05-20-2003, 12:19 AM
Boofo if i want forum member just see their own stats....how

should i do??(the attachment part)...thankz...

Smoothie
05-20-2003, 01:40 AM
number of queries this adds?

Boofo
05-20-2003, 01:48 AM
Today at 08:19 PM squawell said this in Post #16 (https://vborg.vbsupport.ru/showthread.php?postid=397477#post397477)
Boofo if i want forum member just see their own stats....how

should i do??(the attachment part)...thankz...

That would require re-writing the whole hack. The only problem you might have in doing it that way would be if you get a user in a forum that they haven't done a whole lot in, the information would be very low.

Boofo
05-20-2003, 01:54 AM
Today at 09:40 PM Smoothie said this in Post #17 (https://vborg.vbsupport.ru/showthread.php?postid=397499#post397499)
number of queries this adds?

Right now it adds 7 queries (8 with Logician's hack). The old Forum Statistics hack added 6 queries and didn't have the attachments info, Logician's Lastpostminute hack, "your stats" or the last poster. I am in the process of writing the code that will cache those queries and only run them every so many minutes (i.e. 10) in which case it will run 8 queries when it is updating the cache and only one query when it is not. How does that sound? ;)

Boofo
05-20-2003, 02:18 AM
Today at 07:54 PM Reverend said this in Post #15 (https://vborg.vbsupport.ru/showthread.php?postid=397469#post397469)
Just wondering if its possible to edit the font colour for $yourstats via the forumdisplay_quickstats template so that the colour can be set for different styles.

Yes, you can, but it will show the thread and posts numbers in the your stats line at the bottom of the box even if they haven't posted in that thread. Here is how you can do it:

In forumdisplay.php, find:

if ($yourposts !="0") {
$yourstats = "<tr id=\"cat\">
<td bgcolor=\"#1D6AA0\" align=\"center\" nowrap colspan=\"3\"><smallfont><b>$bbuserinfo[username], you have made a total of <i>$yourposts</i> in this forum. (<i>$yourthreads</i> and <i>$yourreplies</i>)</b></smallfont></td>
</tr>";
} else {
$yourstats = "<tr id=\"cat\">
<td bgcolor=\"#1D6AA0\" align=\"center\" nowrap colspan=\"3\"><smallfont><b>$bbuserinfo[username], you have made a total of <i>$yourposts</i> posts in this forum.</b></smallfont></td>
</tr>";
}

and delete it. Then go into the forumdisplay_quickstats template and replace:

$yourstats

with this:

<tr id="cat">
<td bgcolor="#1D6AA0" align="center" nowrap colspan="3"><smallfont><b>$bbuserinfo[username], you have made a total of <i>$yourposts</i> in this forum. (<i>$yourthreads</i> and <i>$yourreplies</i>)</b></smallfont></td>
</tr>

That should do it. ;)

Austin Dea
05-20-2003, 02:22 AM
I install when the stats are cached ;)

Boofo
05-20-2003, 02:32 AM
Today at 10:22 PM Austin Dea said this in Post #21 (https://vborg.vbsupport.ru/showthread.php?postid=397516#post397516)
I install when the stats are cached ;)

The queries that are in it right now are fairly fast queries. I have optimized them as much as I can and on my site it runs quick. ;)

Austin Dea
05-20-2003, 03:01 AM
Yes, but I don't need it right this second. I'll wait =P

sleepbirdcyp
05-20-2003, 03:03 AM
coooooooooooooooool!
Looks good. thx Boofo!

and still waiting for the next stats cached version~

Smoothie
05-20-2003, 03:14 AM
Yesterday at 10:54 PM Boofo said this in Post #19 (https://vborg.vbsupport.ru/showthread.php?postid=397506#post397506)
Right now it adds 7 queries (8 with Logician's hack). The old Forum Statistics hack added 6 queries and didn't have the attachments info, Logician's Lastpostminute hack, "your stats" or the last poster. I am in the process of writing the code that will cache those queries and only run them every so many minutes (i.e. 10) in which case it will run 8 queries when it is updating the cache and only one query when it is not. How does that sound? ;) Sounds good Boofo, nice work, but thats too many queries for my site.

sleepbirdcyp
05-20-2003, 03:18 AM
just waiting for next version

:D

Boofo
05-20-2003, 04:04 AM
Yesterday at 11:14 PM Smoothie said this in Post #25 (https://vborg.vbsupport.ru/showthread.php?postid=397530#post397530)
Sounds good Boofo, nice work, but thats too many queries for my site.

I will be releasing the update (hopefully tomorrow) with the cache. It will only run 1 query when it is not updating the cache. Will that work better for you?

MetroSports82
05-20-2003, 04:12 AM
great work Boofo! ;) works great, and yea i noticed the queries are running fairly quick on my end as well. thanks! ;)

Boofo
05-20-2003, 04:22 AM
Today at 12:12 AM MetroSports82 said this in Post #28 (https://vborg.vbsupport.ru/showthread.php?postid=397552#post397552)
great work Boofo! ;) works great, and yea i noticed the queries are running fairly quick on my end as well. thanks! ;)

Thank you for the kind words. ;) Don't forget to click install so you can be notified when I get the cached version up here in the next day or so.

Smoothie
05-20-2003, 04:35 AM
Today at 01:04 AM Boofo said this in Post #27 (https://vborg.vbsupport.ru/showthread.php?postid=397546#post397546)
I will be releasing the update (hopefully tomorrow) with the cache. It will only run 1 query when it is not updating the cache. Will that work better for you? That might work. :)

Boofo
05-20-2003, 10:11 AM
Ok, here is an update on my progress with the caching. I have it done except for 2 small problems. The main one being how to have it cache each forum. If you go from one forum to another, it won't update the stats until the pre-determined time, so you will be looking at the stats from the forum that was last cached. I will get it figured out and release it here just as soon as I can, hopefully later today. Hang in there, it's coming. ;)

sleepbirdcyp
05-20-2003, 11:32 AM
for example

update the forum stats every 24 hours~

:)

Austin Dea
05-20-2003, 02:43 PM
24 hours? I'd much rather have it every 10 minutes.

Boofo
05-20-2003, 06:54 PM
It will be configurable in that sense to whatever you want.

sleepbirdcyp
05-20-2003, 07:12 PM
come on

can not wait anymore

:D :D :D

Boofo
05-20-2003, 07:41 PM
I'm still trying to figure out the fix for each forum. I'll post it the moment I have it. ;)

Xyphen
05-21-2003, 12:04 AM
Nice piece of work Boofo

Boofo
05-21-2003, 12:10 AM
Today at 08:04 PM AViO 07 said this in Post #37 (https://vborg.vbsupport.ru/showthread.php?postid=397932#post397932)
Nice piece of work Boofo

Thank you. ;) Don't forget to hit install if you want to be notified when I post the caching update.

alkatraz
05-21-2003, 06:16 AM
thx!

installed

TheComputerGuy
05-22-2003, 01:32 AM
Installed :)

csidlernet
05-25-2003, 01:33 AM
This is gotta be the best quick stats thing made!

Boofo
05-25-2003, 01:39 AM
Thank you for the kind words. I am still working on the caching part of it and hope to have something soon.

sleepbirdcyp
05-25-2003, 04:17 AM
thank you!

you are cool!

GuN
05-27-2003, 08:21 PM
Thanks a lot for this hack ! Very cool !
Boofo for the upgrade and grog6 for the release ;).
A quand la version FR ? (le relou :D )
;)

Boofo
05-27-2003, 09:17 PM
Don't forget to click install. I am about to release an updated version with caching and those clicking install will be notified.

legendarysk8er
05-30-2003, 04:23 AM
Nice Hack!

*clicks install

Fi_InCogNiTo
05-31-2003, 06:30 PM
Very nice. Works great on my 2.30

*clicks install

alkatraz
06-03-2003, 12:32 AM
it works and looks great, but I've had to uninstall it as my users were complaining of increased load time.

Boofo
06-03-2003, 12:36 AM
Today at 08:32 PM alkatraz said this in Post #48 (https://vborg.vbsupport.ru/showthread.php?postid=403647#post403647)
it works and looks great, but I've had to uninstall it as my users were complaining of increased load time.

Unless you have a lot of attachments, those queries should run pretty fast. Just remove the attachment code in the template.

vB-Host.com
06-07-2003, 02:41 AM
on forums that have no threads yet you get the following error going to the forum..

Warning: Division by zero in /home/sports/public_html/forumdisplay.php on line 62

Boofo
06-07-2003, 02:46 AM
Today at 10:41 PM vB-Host.com said this in Post #50 (https://vborg.vbsupport.ru/showthread.php?postid=405441#post405441)
on forums that have no threads yet you get the following error going to the forum..

Warning: Division by zero in /home/sports/public_html/forumdisplay.php on line 62

What exactly is that line in your forumdisplay? On my site, the box doesn't even show up in a forum with no threads.

subu1
06-09-2003, 08:20 AM
hi Boofo,

if install your Hack,must i deinstall the another problem Forumdisplay Stats Hack, you renember this Hack, i dont find this Hack in the moment.

The Problem, with the subforums

greetz and thxx

edit: just i find the Prob hack looks here (https://vborg.vbsupport.ru/showthread.php?s=&threadid=52215&perpage=15&display=&pagenumber=1) what i mean

Boofo
06-09-2003, 08:23 AM
You don't need both of them. This one is an extension of that one with optimized queries and more information is all.

subu1
06-09-2003, 08:25 AM
my questions is must i deinstall this Hack (https://vborg.vbsupport.ru/showthread.php?s=&threadid=52215&perpage=15&display=&pagenumber=1) before install your Hack :(

Boofo
06-09-2003, 08:32 AM
Yes, unless you want 2 hacks that basically do the same. ;)

subu1
06-09-2003, 12:47 PM
ok Sir, i do that today evening, because your Hack is more beautifully.

thxxx greetz subu1

Boofo
06-09-2003, 12:58 PM
Thank you for the kind words. Don't forget to click install in case I upgrade this soon. ;)

subu1
06-09-2003, 04:31 PM
hi Boofoo i have install *click install*

i have a little error i can't see the last Poster. Which wrong I made.

Boofo
06-09-2003, 05:50 PM
Did you add the lastpostminute part stuff, too? That is where you get the lastposter from.

subu1
06-09-2003, 09:50 PM
ok thxxx I had still the old code to work. Now it's work:-))

DemonJester
07-11-2003, 09:32 PM
Nice job on this hack, clicks install :)

DigitalXWeb
07-12-2003, 01:52 PM
Quick question Boofo,

Was wondering how I would go about getting the stats to show up at the bottom of the page instead of the top?

Thanks in advance.

legendarysk8er
07-29-2003, 11:58 PM
Ok, I reached my 1000th post today in one of my forums and this is what it displayed

Top Poster: legendarysk8er (1,000=0.01%)

I usually have around 10%. Can someone fix this?

legendarysk8er
07-31-2003, 12:17 AM
*bump* hello?

Boofo
07-31-2003, 04:34 AM
07-29-03 at 07:58 PM legendarysk8er said this in Post #63 (https://vborg.vbsupport.ru/showthread.php?postid=421685#post421685)
Ok, I reached my 1000th post today in one of my forums and this is what it displayed

Top Poster: legendarysk8er (1,000=0.01%)

I usually have around 10%. Can someone fix this?

How many total posts are in that forum?

Mr. Brian
08-24-2003, 04:56 PM
Woa.. That's what I'm looking for!

Nice simple & easy hack, thumbs up. :)

legendarysk8er
09-16-2003, 06:49 PM
How many total posts are in that forum?

There are 21295 posts in it.

SharronH
11-26-2003, 12:59 AM
What's your progress on the cache version Boofo? :)

mmmender
12-01-2003, 07:09 AM
i have the announcement display hack installed on my forum so my forumdisplay.php does not include the line....


,forumdisplay_announcementsonly,forumhome_moderato r


can you tell me where i'd place....


,forumdisplay_announcementsonly,forumhome_moderato r,lastpostminute,forumdisplay_quickstats


.....or how i could alter it to work with my announcement hack?

Deska
12-23-2003, 08:48 AM
I install successfuly but Attachment Bytes Size is not show up because I install Attachment as Files Hack.

Anyone could help?
Thank's.....

Boofo
12-23-2003, 09:07 AM
i have the announcement display hack installed on my forum so my forumdisplay.php does not include the line....


,forumdisplay_announcementsonly,forumhome_moderato r


can you tell me where i'd place....


,forumdisplay_announcementsonly,forumhome_moderato r,lastpostminute,forumdisplay_quickstats


.....or how i could alter it to work with my announcement hack?
That is just the templatesused line. You can stick it in there almost anywhere.

You can also look for:

,forumhome_moderator

and replace it with:

,forumhome_moderator,lastpostminute,forumdisplay_q uickstats

Boofo
12-23-2003, 09:09 AM
I install successfuly but Attachment Bytes Size is not show up because I install Attachment as Files Hack.

Anyone could help?
Thank's.....
I think those sizes have to be read from the directory. I read the sizes from the db. I'm not sure how to go about reading them for that hack, sorry. :nervous:

You can also comment the line for the attachments out of the template since it doesn't read the sizes for that hack.

Cheeko
06-10-2004, 11:12 PM
hmm.. i cant get it to work on v 3.0.1

Battle_Ring
07-26-2004, 04:39 PM
Very Nice Hack Boofo...
Easily Installed...