Extension:VBulletin stats

WARNING: Some of the information on this page refers to a site that was username/password restricted. Fortunately the source code could be recovered from the Internet Archive Wayback Machine. Excellent illustration of why code should be hosted on google code, sourceforge or similar.

Description
Note: the most up-to-date version of this extension will be on my wiki. I wanted to incorporate my vBulletin forum statistics into my wiki page(s). So I looked into creating an extension and came out with this - the vBStats extension. It retrieves an array of data from your vBulletin database and displays it according to conditions you supply (a list of conditions is below).

This hack has been tested on the following vBulletin and MediaWiki combinations;

Demo
You can see a demonstration of this extension in action here. (password protected now)

Installation
To install the script, copy the source code available at the bottom of this page (choose between versions 3.0.8 and 3.5.2), save it to a file named vbStats.php and upload it to yourwiki/extensions/

Next, put the following code at the bottom of your localSettings.php file:

Finally, change these values in vbStats.php:

Options
To use the script, simply put the following tags in a mediaWiki article;

 limit=[number] sort=[ASC,DESC] order by=[date,title,rand] 

 limit=[number] sort=[ASC,DESC] order by=[posts,joindate,username,rand] 

 show total posts=[true,false] show total threads=[true,false] show total members=[true,false] show largest thread=[true,false] show most popular thread=[true,false] show most popular forum=[true,false] 

 show active users=[true,false] show inactive users=[true,false] show sub-heading=[true,false] show last 30 days=[true,false] show last 14 days=[true,false] show last 7 days=[true,false] 

Example
 limit=5 sort=DESC order by=date 

Support/Requests
Please post any questions or requests (additions to the script you would like) on the vBulletin Stats extension page on my wiki. I rarely check the wikiMedia website.