PDA

View Full Version : vBulletin CMS Widgets - [WIDGET] Forum Stats


cory_booth
02-19-2010, 10:00 PM
This is a simple widget to display some forum stats.

It would really like to see this combined with the Currently Online and Site Visitor's Widgets...

But until then, I am using this PHP Widget...

Feel free to use/hack/slash the code for your own needs...

Navigate to AdminCP -> CMS -> Widgets.
Create a PHP Type Widget and paste the below code.



ob_start();
global $vbulletin, $db, $vbphrase;
//Begin Forum Stats
// forum stats start
$numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user");
$numbermembers = number_format($numbersmembers['users']);
$counter = $db->query_first("SELECT COUNT(postid) AS posts, COUNT(threadid) AS threads FROM " . TABLE_PREFIX . "post");
$totalposts=number_format($counter['posts']);
$countthreads = $db->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");
$totalthreads=number_format($countthreads['threads']);
// forum stats end

// total online start
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$headerguests=$db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "session WHERE userid=0 AND lastactivity>$datecut");
$headerusers=$db->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM " . TABLE_PREFIX . "session WHERE " . TABLE_PREFIX . "session.userid>0 AND " . TABLE_PREFIX . "session.lastactivity>$datecut");
$headerguests=$headerguests[count];
$headerusers=$headerusers[count];
$totalonline=$headerguests+$headerusers;
// total online end

// get newest member name and userid start
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid=$numbersmembers[max]");
$newusername = $getnewestmember['username'];
$newuserid = $getnewestmember['userid'];
// get newest member name and userid end

//End Forum Status
//SideBar - Begin forum Stats
$sb_stats='
<table width="100%" align="center"> <tr> <td class="" align="left"> <div class="smallfont"> <strong>Number of Members: </strong> '.$numbermembers.'<br /> <strong>Total Threads: </strong>'. $totalthreads.'<br /> <strong>Total Posts: </strong>'. $totalposts.'<br /> <strong>Currently Online: </strong>'. $totalonline.'<br /> <br /> <strong>Newest Member:</strong> <a href="'.$vboptions[bburl].'/member.php?u='.$newuserid.'"><b>'.$newusername.'</b></a> </td> </tr> </table>';
//SideBar = End forum Status
echo $sb_stats;
$output=ob_get_contents();
ob_end_clean();

IR15H
02-20-2010, 03:08 PM
Awesome! I tried to do this a while ago but failed miserably. Thanks :).

cory_booth
02-20-2010, 03:25 PM
Awesome! I tried to do this a while ago but failed miserably. Thanks :).

Hey thanks!

I know this isn't pro or anything and not using "caching" but - well until something better comes along :-)

210665
02-20-2010, 03:37 PM
Thanks
is a good Product

gothi
02-20-2010, 04:52 PM
Awesome! I love this Widget. I've been waiting all this time.
I have another Widget: "Widget - Users Online" https://vborg.vbsupport.ru/showthread.php?t=230428&highlight=widget+user+online

My dream is if both would be a widget, but I can not php. which should not be that hard, right?

(sorry my english is terrible)

DesignWerks
02-20-2010, 05:33 PM
Nice! Thanks!

cory_booth
02-20-2010, 05:36 PM
Lynne has got mad skillz and is properly templating and caching her widget.

But I suppose you could merge my code with hers...
I haven't tried it yet, so...

Add this:

global $vbulletin, $db, $vbphrase;
//Begin Forum Stats
// forum stats start
$numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user");
$numbermembers = number_format($numbersmembers['users']);
$counter = $db->query_first("SELECT COUNT(postid) AS posts, COUNT(threadid) AS threads FROM " . TABLE_PREFIX . "post");
$totalposts=number_format($counter['posts']);
$countthreads = $db->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");
$totalthreads=number_format($countthreads['threads']);
// forum stats end

// total online start
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$headerguests=$db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "session WHERE userid=0 AND lastactivity>$datecut");
$headerusers=$db->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM " . TABLE_PREFIX . "session WHERE " . TABLE_PREFIX . "session.userid>0 AND " . TABLE_PREFIX . "session.lastactivity>$datecut");
$headerguests=$headerguests[count];
$headerusers=$headerusers[count];
$totalonline=$headerguests+$headerusers;
// total online end

// get newest member name and userid start
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid=$numbersmembers[max]");
$newusername = $getnewestmember['username'];
$newuserid = $getnewestmember['userid'];
// get newest member name and userid end

//End Forum Status

//SideBar - Begin forum Stats
$sb_stats='
<table width="100%" align="center"> <tr> <td class="" align="left"> <div class="smallfont"> <strong>Number of Members: </strong> '.$numbermembers.'<br /> <strong>Total Thread: </strong>'. $totalthreads.'<br /> <strong>Total Posts: </strong>'. $totalposts.'<br /> <strong>Currently Online: </strong>'. $totalonline.'<br /> <br /> <strong>Newest Member:</strong> <a href="'.$vboptions[bburl].'/member.php?u='.$newuserid.'"><b>'.$newusername.'</b></a></td> </tr> </table>';
//SideBar = End forum Status
echo $sb_stats;

Just before her:
$output=ob_get_contents();
ob_end_clean();

At the end...

gothi
02-21-2010, 07:24 AM
Thanks for your help, Cory. But I dont find the Code:


Just before her:
$output=ob_get_contents();
ob_end_clean();

At the end...

;_;

aberg
02-21-2010, 06:45 PM
Thanks, this is really a good widget.
I have try to merge some code with the widget from Lynne but that doesn't work.
What I like to see is a link to the users online.
Maybe something for the next version.

RedHacker
02-22-2010, 07:21 AM
How to display...?

Number of Members ----> Members
Currently Online ----> Online Users

cory_booth
02-22-2010, 03:51 PM
How to display...?

Number of Members ----> Members
Currently Online ----> Online Users

Um...

I thought this was in there already?
or did you mean put the lines in that order (I suppose that would make more sense).

RedHacker
02-23-2010, 05:02 AM
Translate....

zulfiqar.halari
02-23-2010, 07:00 AM
Hi. Can we get this mod for vb4. I will be grateful.

https://vborg.vbsupport.ru/showthread.php?t=200609&highlight=live+header

Regards

x626xblack
02-23-2010, 04:39 PM
You may want to put WIDGET in the thread title. I as other people i assume do searches for new widgets in the title. This one does not come up.

kevinchappell
02-23-2010, 05:30 PM
Thank you!

Brew
02-23-2010, 07:55 PM
All I get is today's date :(

RedHacker
02-24-2010, 05:30 AM
How to display...?

Number of Members ----> Members
Currently Online ----> Online Users

cory_booth for this anything....?

cory_booth
02-26-2010, 10:41 AM
All I get is today's date :(

Huh... I have no idea about this one...

cory_booth
02-26-2010, 10:44 AM
cory_booth for this anything....?

I didn't quite understand your request, but I made the change I think you wanted:

ob_start();
global $vbulletin, $db, $vbphrase;
//Begin Forum Stats
// forum stats start
$numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user");
$numbermembers = number_format($numbersmembers['users']);
$counter = $db->query_first("SELECT COUNT(postid) AS posts, COUNT(threadid) AS threads FROM " . TABLE_PREFIX . "post");
$totalposts=number_format($counter['posts']);
$countthreads = $db->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");
$totalthreads=number_format($countthreads['threads']);
// forum stats end

// total online start
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$headerguests=$db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "session WHERE userid=0 AND lastactivity>$datecut");
$headerusers=$db->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM " . TABLE_PREFIX . "session WHERE " . TABLE_PREFIX . "session.userid>0 AND " . TABLE_PREFIX . "session.lastactivity>$datecut");
$headerguests=$headerguests[count];
$headerusers=$headerusers[count];
$totalonline=$headerguests+$headerusers;
// total online end

// get newest member name and userid start
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid=$numbersmembers[max]");
$newusername = $getnewestmember['username'];
$newuserid = $getnewestmember['userid'];
// get newest member name and userid end

//End Forum Status
//SideBar - Begin forum Stats
$sb_stats='
<table width="100%" align="center"> <tr> <td class="" align="left"> <div class="smallfont"> <strong>Members: </strong> '.$numbermembers.'<br /> <strong>Total Threads: </strong>'. $totalthreads.'<br /> <strong>Total Posts: </strong>'. $totalposts.'<br /> <strong>Online Users: </strong>'. $totalonline.'<br /> <br /> <strong>Newest Member:</strong> <a href="'.$vboptions[bburl].'/member.php?u='.$newuserid.'"><b>'.$newusername.'</b></a> </td> </tr> </table>';
//SideBar = End forum Status
echo $sb_stats;
$output=ob_get_contents();
ob_end_clean();

Just replace the code with this...

webspider
02-27-2010, 10:59 AM
Hi
Great addon.

Is there anyway to add attachment stats? Like Total attachments and Total downloads?

Thanks,
Peter

RedHacker
02-27-2010, 12:05 PM
I didn't quite understand your request, but I made the change I think you wanted:

ob_start();
global $vbulletin, $db, $vbphrase;
//Begin Forum Stats
// forum stats start
$numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user");
$numbermembers = number_format($numbersmembers['users']);
$counter = $db->query_first("SELECT COUNT(postid) AS posts, COUNT(threadid) AS threads FROM " . TABLE_PREFIX . "post");
$totalposts=number_format($counter['posts']);
$countthreads = $db->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");
$totalthreads=number_format($countthreads['threads']);
// forum stats end

// total online start
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$headerguests=$db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "session WHERE userid=0 AND lastactivity>$datecut");
$headerusers=$db->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM " . TABLE_PREFIX . "session WHERE " . TABLE_PREFIX . "session.userid>0 AND " . TABLE_PREFIX . "session.lastactivity>$datecut");
$headerguests=$headerguests[count];
$headerusers=$headerusers[count];
$totalonline=$headerguests+$headerusers;
// total online end

// get newest member name and userid start
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid=$numbersmembers[max]");
$newusername = $getnewestmember['username'];
$newuserid = $getnewestmember['userid'];
// get newest member name and userid end

//End Forum Status
//SideBar - Begin forum Stats
$sb_stats='
<table width="100%" align="center"> <tr> <td class="" align="left"> <div class="smallfont"> <strong>Members: </strong> '.$numbermembers.'<br /> <strong>Total Threads: </strong>'. $totalthreads.'<br /> <strong>Total Posts: </strong>'. $totalposts.'<br /> <strong>Online Users: </strong>'. $totalonline.'<br /> <br /> <strong>Newest Member:</strong> <a href="'.$vboptions[bburl].'/member.php?u='.$newuserid.'"><b>'.$newusername.'</b></a> </td> </tr> </table>';
//SideBar = End forum Status
echo $sb_stats;
$output=ob_get_contents();
ob_end_clean();

Just replace the code with this...

Thanks..

webspider
02-27-2010, 12:41 PM
Actually with this code all I get is the date.

What I was asking for was attachment statistics. In the AdminCP > Attachments > Attachment Statistics you get data for several things:

Unique / Total Attachments 83,938
Attachment Filesize Sum 12.61 GB
Disk Space Used 12.34 GB
Storage Type Attachments are currently being stored in the filesystem at /var/www/site/
Average Attachment Filesize 157.6 KB
Total Downloads 3,840,776

cory_booth
03-05-2010, 06:03 PM
Actually with this code all I get is the date.

What I was asking for was attachment statistics. In the AdminCP > Attachments > Attachment Statistics you get data for several things:

Unique / Total Attachments 83,938
Attachment Filesize Sum 12.61 GB
Disk Space Used 12.34 GB
Storage Type Attachments are currently being stored in the filesystem at /var/www/site/
Average Attachment Filesize 157.6 KB
Total Downloads 3,840,776

Hmm...
Sorry this was not the purpose of this widget.

Ricsca
03-19-2010, 08:46 PM
If the forum in is in the forum folter?

iyama
03-25-2010, 11:34 AM
Maybe include Top poster ?

nul7
04-03-2010, 06:59 PM
^^^Yeah I was going to say the same thing...kind of like 3.8 had on vbadvance module.

Members: 1,976
Threads: 8,585
Posts: 111,082
Top Poster: XXXXXXXX (6536)

Welcome to our newest member:
XXXXXXXXX

nul7
04-03-2010, 07:08 PM
great mod, installed and works great, for the guys/gals getting the time stamp only...make sure you are configuring the php and not putting it in the description box...same thing I did until I realized I was being silly.

just if we could get the top posted code... Me + PHP Coding = fail

axix20xx
04-20-2010, 06:57 AM
All I get is today's date :(

Same Here for this and Recent Thread az so ...

Huh... I have no idea about this one...

So how can we fix It ?

zulfiqar.halari
04-20-2010, 12:35 PM
This widget is not working in my Forum as i am not using CMS, rather i want to use it in side bar of my vBulletin forum but its not working and showing as blank.

Let me know whats the correct code to display it in our forum widget side bar.

Regards

Reef Man
04-23-2010, 06:07 PM
Installed and working.

If you want it translated to spanish, here you have the code:


ob_start();
global $vbulletin, $db, $vbphrase;
//Begin Forum Stats
// forum stats start
$numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user");
$numbermembers = number_format($numbersmembers['users']);
$counter = $db->query_first("SELECT COUNT(postid) AS posts, COUNT(threadid) AS threads FROM " . TABLE_PREFIX . "post");
$totalposts=number_format($counter['posts']);
$countthreads = $db->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");
$totalthreads=number_format($countthreads['threads']);
// forum stats end

// total online start
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$headerguests=$db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "session WHERE userid=0 AND lastactivity>$datecut");
$headerusers=$db->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM " . TABLE_PREFIX . "session WHERE " . TABLE_PREFIX . "session.userid>0 AND " . TABLE_PREFIX . "session.lastactivity>$datecut");
$headerguests=$headerguests[count];
$headerusers=$headerusers[count];
$totalonline=$headerguests+$headerusers;
// total online end

// get newest member name and userid start
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid=$numbersmembers[max]");
$newusername = $getnewestmember['username'];
$newuserid = $getnewestmember['userid'];
// get newest member name and userid end

//End Forum Status
//SideBar - Begin forum Stats
$sb_stats='
<table width="100%" align="center"> <tr> <td class="" align="left"> <div class="smallfont"> <strong>Numero de Miembros: </strong> '.$numbermembers.'<br /> <strong>Temas: </strong>'. $totalthreads.'<br /> <strong>Mensajes: </strong>'. $totalposts.'<br /> <strong>Usuarios en linea: </strong>'. $totalonline.'<br /> <br /> <strong>?ltimo miembro registrado:</strong> <a href="'.$vboptions[bburl].'/member.php?u='.$newuserid.'"><b>'.$newusername.'</b></a> </td> </tr> </table>';
//SideBar = End forum Status
echo $sb_stats;
$output=ob_get_contents();
ob_end_clean();

Robert Carver
05-03-2010, 02:36 PM
I have implemented this widget on my site, but I seem to have a few issues.

1. The total number of members shown in the widget does not correspond with the total number shown on the forumhome page.

2. The newest member does not correspond with what is on my home page. Does VB4 nowonly show members that are "registered" and not just awaiting email confirmation?

3. The link to the newest member does not point to the forum directory, and clicking on it gives a "page not found" error. Instead, it points to member.php in my root.

Anyway help would sure be appreciated! Thanks in advance.

ArminTECH
05-17-2010, 05:37 AM
tagged

Filgga
06-03-2010, 02:30 PM
This widget is not working in my Forum as i am not using CMS, rather i want to use it in side bar of my vBulletin forum but its not working and showing as blank.

Let me know whats the correct code to display it in our forum widget side bar.

Regards
None responded to this... SAD

cmiller1014
07-11-2010, 01:33 AM
All it does it shows today's date. Sounded good, but had to remove it.

7thSENSE
07-21-2010, 06:09 AM
Did you forget to copy the widget's code into the widget? :)

Besides, I can confirm the issues from Robert Carver.

MrD
08-15-2010, 09:26 AM
Hi,
in VB4.0.6 the CMS are not displayed if the Widget is active.
Only a whiteSite, that the Website are not displayed

chriske
08-28-2010, 10:28 PM
How can i edit this widget so that only the members who confirmed their email address show up in the forum stats (just like on the bottom of the forum itself?)

customcolor
09-14-2010, 02:39 AM
3. The link to the newest member does not point to the forum directory, and clicking on it gives a "page not found" error. Instead, it points to member.php in my root.

i found out how to direct it to the forums folder...it works for me now...here is all the code i have and its just like the first post with the direction edit and the time thing at the top too

$output = date(vB::$vbulletin->options['dateformat']) . "<br />\n";



ob_start();
global $vbulletin, $db, $vbphrase;
//Begin Forum Stats
// forum stats start
$numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user");
$numbermembers = number_format($numbersmembers['users']);
$counter = $db->query_first("SELECT COUNT(postid) AS posts, COUNT(threadid) AS threads FROM " . TABLE_PREFIX . "post");
$totalposts=number_format($counter['posts']);
$countthreads = $db->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");
$totalthreads=number_format($countthreads['threads']);
// forum stats end

// total online start
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$headerguests=$db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "session WHERE userid=0 AND lastactivity>$datecut");
$headerusers=$db->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM " . TABLE_PREFIX . "session WHERE " . TABLE_PREFIX . "session.userid>0 AND " . TABLE_PREFIX . "session.lastactivity>$datecut");
$headerguests=$headerguests[count];
$headerusers=$headerusers[count];
$totalonline=$headerguests+$headerusers;
// total online end

// get newest member name and userid start
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid=$numbersmembers[max]");
$newusername = $getnewestmember['username'];
$newuserid = $getnewestmember['userid'];
// get newest member name and userid end

//End Forum Status
//SideBar - Begin forum Stats
$sb_stats='
<table width="100%" align="center"> <tr> <td class="" align="left"> <div class="smallfont"> <strong>Number of Members: </strong> '.$numbermembers.'<br /> <strong>Total Threads: </strong>'. $totalthreads.'<br /> <strong>Total Posts: </strong>'. $totalposts.'<br /> <strong>Currently Online: </strong>'. $totalonline.'<br /> <br /> <strong>Newest Member:</strong> <a href="'.$vboptions[bburl].'/forums/member.php?u='.$newuserid.'-'.$newusername.'"><b>'.$newusername.'</b></a> </td> </tr> </table>';
//SideBar = End forum Status
echo $sb_stats;
$output=ob_get_contents();
ob_end_clean();

chriske
10-13-2010, 09:06 PM
How can i edit this widget so that only the members who confirmed their email address show up in the forum stats (just like on the bottom of the forum itself?)

hate to bump it, but it bugs me :P

goshalim
10-28-2010, 04:56 PM
Hi i copy the code and it came out the calender !!!!!!!!!insteat of the stats

COL NIL SATIS
10-28-2010, 06:29 PM
This widget is not working in my Forum as i am not using CMS, rather i want to use it in side bar of my vBulletin forum but its not working and showing as blank.

Let me know whats the correct code to display it in our forum widget side bar.

Regards

any ideas guys ...will this work in the side blocks???

goshalim
10-30-2010, 04:03 AM
Same Here for this and Recent Thread az so ...



So how can we fix It ?

Ok Guys i found it how it works !!!!

Go to tha admin panel and open the widgets section
Then find the widget which you creat and then press configure.

Then delete what is in the box and copy again the PHP code.

press Ok and thats it !!!!

goshalim
10-30-2010, 04:05 AM
All I get is today's date :(


Ok Guys i found it how it works !!!!

Go to tha admin panel and open the widgets section
Then find the widget which you creat and then press configure.

Then delete what is in the box and copy again the PHP code.

press Ok and thats it !!!!

soul86
12-01-2010, 08:55 AM
So nice man . Thank you

RedHacker
12-10-2010, 06:41 AM
I have 4.1.0 Version and when login show all number of members. When refresh the page at the members stats missing three members. Why....?

chriske
12-10-2010, 12:49 PM
They are probaply in the usergroup: users awaiting email confirmation.

LuucEarth
12-13-2010, 02:03 AM
Thank you very much.

Ive used this with some slight modifications to add the ability to track Active(posted in forums in the last 2 weeks) members of the armies in our tournaments.

ehsanix
01-05-2011, 06:14 AM
If I want
The destination would be on our website indexes on a blank page php
What do I do?

traen
01-30-2011, 05:25 PM
Thanks worked like a charm on 4.1.1.

fidelTFG
02-24-2011, 12:42 AM
How do I get rid of the php logo on the template?

Joe Blow
02-27-2011, 07:07 PM
1. The total number of members shown in the widget does not correspond with the total number shown on the forumhome page.

I am experiencing the same issue. I have a private forum that I do not want included in the Total Posts. I would like to know how to get the widget to display the same number of posts as the Forum Home displays.

Joe Blow
05-20-2011, 04:10 PM
I am experiencing the same issue. I have a private forum that I do not want included in the Total Posts. I would like to know how to get the widget to display the same number of posts as the Forum Home displays.

Anyone?

toxin
07-01-2011, 01:23 PM
You can change the first few lines to get more accurate thread and post counts (and to display the same numbers as the stats block on the forumhome):




// forum stats start
$vboptions[bburl] = $vbulletin->options[bburl];
$numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user");
$numbermembers = number_format($numbersmembers['users']);

$counter=$db->query_first("SELECT sum(replycount) as posts FROM " . TABLE_PREFIX . "forum");
$totalposts=number_format($counter['posts']);

$counter=$db->query_first("SELECT sum(threadcount) as threads FROM " . TABLE_PREFIX . "forum");
$totalthreads=number_format($counter['threads']);

// forum stats end

MySaltyreef
07-10-2011, 12:12 AM
just what the doctor ordered, thanks ! nominated

Joe Blow
07-18-2011, 07:29 AM
You can change the first few lines to get more accurate thread and post counts (and to display the same numbers as the stats block on the forumhome):




// forum stats start
$vboptions[bburl] = $vbulletin->options[bburl];
$numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user");
$numbermembers = number_format($numbersmembers['users']);

$counter=$db->query_first("SELECT sum(replycount) as posts FROM " . TABLE_PREFIX . "forum");
$totalposts=number_format($counter['posts']);

$counter=$db->query_first("SELECT sum(threadcount) as threads FROM " . TABLE_PREFIX . "forum");
$totalthreads=number_format($counter['threads']);

// forum stats end



You da man toxin!!!!!

Thank you, much appreciated! :)

kylek
08-06-2011, 12:06 AM
Works great except for the new member link it makes. In our case it adds an "s" to forum in the link to the members profile.

/forums/member.php?

Anyone know how to change that?

mikkster
08-29-2011, 12:12 PM
works fine with 4.1.4

Thank you for this one!

doctorsexy
08-29-2011, 01:30 PM
Works with 4.1.5...thank you

ptceuro
04-01-2012, 10:00 PM
Awesome! I tried to do this a while ago but failed miserably. Thanks

Onkeltyson
05-18-2012, 03:34 PM
Thanks for this ;-)

Konsoleplanet
09-03-2012, 06:51 PM
you have this code for this stats ?

https://vborg.vbsupport.ru/external/2012/09/30.jpg

car20
12-31-2012, 02:15 AM
thanks-installed

Jpolola
04-12-2013, 01:23 PM
Thank you! works on 4.2 PL3

WriteToEnlight
06-23-2019, 11:29 PM
"

( Maybe something like a "rough draft" at the moment ..? )

Maybe something like looking a bit different than pictured in Vbulletin 4.2.5 at this time ?

( With a PHP symbol by.. in the "widget" ? )

"