Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[WIDGET] Forum Stats Details »»
[WIDGET] Forum Stats
Version: 1.00, by cory_booth cory_booth is offline
Developer Last Online: Jun 2013 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.0.2 Rating:
Released: 02-19-2010 Last Update: Never Installs: 205
Re-useable Code Is in Beta Stage  
No support by the author.

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.


PHP 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(); 

Screenshots

File Type: jpg stats.jpg (18.0 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
kylek, mikesafl

Comments
  #62  
Old 09-03-2012, 06:51 PM
Konsoleplanet Konsoleplanet is offline
 
Join Date: Apr 2011
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you have this code for this stats ?

Reply With Quote
  #63  
Old 12-31-2012, 02:15 AM
car20's Avatar
car20 car20 is offline
 
Join Date: Feb 2008
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks-installed
Reply With Quote
  #64  
Old 04-12-2013, 01:23 PM
Jpolola Jpolola is offline
 
Join Date: Mar 2011
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you! works on 4.2 PL3
Reply With Quote
  #65  
Old 06-23-2019, 11:29 PM
WriteToEnlight's Avatar
WriteToEnlight WriteToEnlight is offline
 
Join Date: Dec 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"

( 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" ? )

"
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:03 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04968 seconds
  • Memory Usage 2,289KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (5)post_thanks_box
  • (2)post_thanks_box_bit
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (5)post_thanks_postbit_info
  • (4)postbit
  • (1)postbit_attachment
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete