View Full Version : Simple Forum Usage Statistics
Paul M
04-21-2006, 10:00 PM
This modification is no longer available or supported.
This is a little custom hack originally written for Jilly.
This adds an option to the forum tools dropdown menu to display three counts for the forum (and sub forums if you click on the link) - Number of New Posts, Number of New Threads and Number of Unique Posters - all for a preset time limit (in days). The days and usergroups allowed to use it this function are defined in the ACP.
Unzip the xml file and import it into vbulletin via the product manager, then set the options (in the vb options > forum display options). 7 Days and usergroups 5,6 & 7 are the defaults.
History:
v1.01 : First Private Release.
v1.02 : Minor changes, no update necessary.
v1.03 : Permissions added.
v1.04 : Forum Tools Link Automated.
v1.05 : First Public Release.
v1.06 : Fixed missing table prefixes on joins.
v1.07 : Fixed more table prefix errors.
Mr Chad
04-22-2006, 04:12 PM
Looks pretty good, Installin.
klaush
04-22-2006, 04:31 PM
Mhhhh:
Invalid SQL:
SELECT COUNT(post.dateline) AS postcount
FROM vb3_post AS post
LEFT JOIN thread on post.threadid = thread.threadid
WHERE post.dateline > 1145122278 AND thread.forumid IN (32);
MySQL-Fehler : Table 'usr_web2_3.thread' doesn't exist
---
Thanks!:-)
XanTrax
04-22-2006, 04:51 PM
Need to include table prefix in the code.
Paul M
04-22-2006, 05:12 PM
Oops, a table prefix missing on the joins - 1.06 uploaded to fix it.
topsoftware
04-22-2006, 05:45 PM
where is the link
Paul M
04-22-2006, 05:54 PM
As it says ;
This adds an option to the forum tools dropdown menu
Boofo
04-22-2006, 06:12 PM
Nice idea. ;)
Are you planning on adding any other statistics to this?
Atakan KOC
04-22-2006, 06:12 PM
Nice. Thanks
Database error in vBulletin 3.5.4:
Invalid SQL:
SELECT COUNT(post.dateline) AS postcount
FROM forumziki_post AS post
LEFT JOIN forumziki_thread on post.threadid = thread.threadid
WHERE post.dateline > 1145129031 AND thread.forumid IN (2);
MySQL Error : Unknown column 'thread.forumid' in 'where clause'
Error Number : 1054
Date : Saturday, April 22nd 2006 @ 03:23:51 PM
Script : http://www.xxxxxxxxxx.com/forums/misc.php?do=forumstats&f=2
Referrer : http://www.xxxxxxx.com/forums/forumdisplay.php?f=2
IP Address : XXXXXXX
Username : ZIKI-SET
Classname : vb_database
Paul M
04-22-2006, 06:29 PM
Nice idea. ;)
Are you planning on adding any other statistics to this?What it has now is what was required by the original requestor, so I haven't really thought about it. What other stats were you thinking of ?
Paul M
04-22-2006, 06:44 PM
MySQL Error : Unknown column 'thread.forumid' in 'where clause'
Error Number : 1054
Date : Saturday, April 22nd 2006 @ 03:23:51 PM
Script : http://www.xxxxxxxxxx.com/forums/misc.php?do=forumstats&f=2
Referrer : http://www.xxxxxxx.com/forums/forumdisplay.php?f=2
IP Address : XXXXXXX
Username : ZIKI-SET
Classname : vb_databaseAaaarrrggg, bloody table prefixes should be banned. :cross-eyed:
Fixed.
tei727
04-22-2006, 06:50 PM
MySQL Error : Unknown table 'thread' in where clause
Error Number : 1109
Paul M
04-22-2006, 07:05 PM
MySQL Error : Unknown table 'thread' in where clause
Error Number : 1109Posting only a small part of the error message is not much use to me, but I think that's fixed by 1.07 anyway - I can't see any stupid prefix changes I've missed now.
Note to self: I really must set-up a test forum using prefixes.
Boofo
04-22-2006, 07:09 PM
What it has now is what was required by the original requestor, so I haven't really thought about it. What other stats were you thinking of ?
Last Poster, Link to last post, stuff like that. I might add some things to it that I use for my forumstatistics Cache hack. Using the datastore would be better if you have a lot of staff using it all the time. But they really shouldn't be, I would think. Scratch the datstore idea. ;)
Now I get
Database error in vBulletin 3.5.4:
Invalid SQL:
SELECT COUNT(post.dateline) AS postcount
FROM forumziki_post AS post
LEFT JOIN forumziki_thread on post.threadid = thread.threadid
WHERE post.dateline > 1145131653 AND thread.forumid IN (2);
MySQL Error : Unknown column 'thread.forumid' in 'where clause'
Error Number : 1054
Date : Saturday, April 22nd 2006 @ 04:07:33 PM
Script : http://www.xxxxxxxxx.com/forums/misc.php?do=forumstats&f=2
Referrer : http://www.xxxxxxxx.com/forums/forumdisplay.php?f=2
IP Address : XXXXXXX
Username : ZIKI-SET
Classname : vb_database
tei727
04-22-2006, 07:19 PM
Database error in vBulletin 3.5.4:
Invalid SQL:
SELECT COUNT(post.dateline) AS postcount
FROM nukepost AS post
LEFT JOIN nukethread on post.threadid = thread.threadid
WHERE post.dateline > 1145132315 AND thread.forumid IN (21);
MySQL Error : Unknown table 'thread' in where clause
Error Number : 1109
Date : Saturday, April 22nd 2006 @ 03:18:35 PM
Script : http://xxxxxxxxmisc.php?do=forumstats&f=21
Referrer : http://xxxxxxxxxxxxxxx/forumdisplay.php?f=21
IP Address : 69.251.126.92
Username : xxxxxxxx
Classname : vb_database
Paul M
04-22-2006, 07:23 PM
Ziki, that isn't v1.07, make sure you re-downloaded it, extracted it etc.
This is the SQL in 1.07, you have the bold bit missing (as in v1.06).
SELECT COUNT(post.dateline) AS postcount
FROM ".TABLE_PREFIX."post AS post
LEFT JOIN ".TABLE_PREFIX."thread AS thread ON post.threadid = thread.threadid
Same applies to you tei727 - that sql is not from the current version.
Floris
04-22-2006, 11:26 PM
What it has now is what was required by the original requestor, so I haven't really thought about it. What other stats were you thinking of ?
Total times the forum has been viewed by members (and guests): 5 (12)
hotwheels
04-22-2006, 11:26 PM
very nice paul m.............
Paul M
04-23-2006, 12:31 AM
Total times the forum has been viewed by members (and guests): 5 (12)Unless you know something I don't - then I don't think there is any way to extract that data - vB does not keep such records.
Boofo
04-23-2006, 10:50 AM
Unless you know something I don't - then I don't think there is any way to extract that data - vB does not keep such records.
This will give you total thread views and replies in a forum:
$numcount=$db->query_first("
SELECT COUNT(threadid) AS threads, SUM(replycount) AS replies, SUM(views) AS views
FROM " . TABLE_PREFIX . "thread
WHERE forumid=$forumid
");
This is what I use for my Forumdisplay stats cache hack. ;)
Paul M
04-23-2006, 11:54 AM
This will give you total thread views and replies in a forum:
Ah yes, but that count is not over a time period, and cannot be split between members and guests, which is what I meant. :)
Boofo
04-23-2006, 02:42 PM
Ah yes, but that count is not over a time period, and cannot be split between members and guests, which is what I meant. :)
True, but still nice to have, I guess. ;)
Invalid ID
04-24-2006, 03:59 AM
It's not showing any result
Bounce
05-01-2006, 09:23 PM
Installed and working well
Thanks Paul
jilly
05-14-2006, 02:46 PM
This is a really useful hack for my board - Paul did a fantastic job - I have the mods turn in a weekly report on their forums, and that gets conglomerated into one big report to keep tabs on the site in general - the stats each week are an important part of showing the traffic each forum is getting, how many posters, etc.
One troubleshooting thing - you have to be either a mod attached to that specific board, or supermod or administrator to run the reports.
Is it possible to show / display Links to e.g. the started Threads in the last 30 Days ?
ubercool
08-01-2006, 02:13 PM
True, but still nice to have, I guess. ;)
Are you thinking about incorporating this feature? I'm looking for a way to track views for each forum, or do you show this already?
:)
Paul M
08-01-2006, 03:01 PM
Are you thinking about incorporating this feature? I'm looking for a way to track views for each forum, or do you show this already?
Nope. No changes will be made to my 3.5 hacks, and I have no plans to release a vb 3.6 specific version.
Freak0204
07-31-2007, 01:20 PM
How do I change this to make it display 30 days instead of 7?
ETA: Nevermind. It's in the options. lol
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.