Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 07-15-2004, 12:51 AM
Jack28 Jack28 is offline
 
Join Date: Jan 2002
Location: The Netherlands
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default User(+Forum?)Stats on a NON-VB Page!

UserStats on a NON-VB Page!
and if possible ForumStats like:

Currently Active Users: 145 (47 members and 98 guests)
Threads: 37,933
Posts: 359,546
Members: 51,820
Newest member: YBnormal

can anyone make this mini-mod plz!

thnx,
JaCky
Reply With Quote
  #2  
Old 07-17-2004, 01:14 AM
Jack28 Jack28 is offline
 
Join Date: Jan 2002
Location: The Netherlands
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #3  
Old 07-17-2004, 01:51 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[sql]
select * from datastore where title='userstats'
[/sql]

Unserialize this and you will have an array with entries numbermembers, newusername and newuserid.

[sql]
select * from datastore where title='forumcache'
[/sql]

Unserialize this which will give you an multi-dimensional associative array with all forum information. Loop through this array and accumulate threadcount and replycount.

'Who is online' is a bit more complicated. Take a look at index.php after
PHP Code:
// ### LOGGED IN USERS ################################################# 
to see how vBulletin does it.
Reply With Quote
  #4  
Old 07-17-2004, 01:42 PM
Jack28 Jack28 is offline
 
Join Date: Jan 2002
Location: The Netherlands
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so? how will it be when i make just one single forumstats.php page?

do i need to use includes n stuff?
Reply With Quote
  #5  
Old 02-07-2006, 03:26 AM
mchaos mchaos is offline
 
Join Date: Jan 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I too am trying to put who is online on a non vb page, Have tryed many things, with little progress, how bout a hand...
Reply With Quote
  #6  
Old 02-09-2006, 01:34 PM
virtualraceday virtualraceday is offline
 
Join Date: Dec 2005
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try this... it works for vb 3.5.x

PHP Code:
<?php
// Connecting to your database
mysql_connect(DB_HOSTDB_USERDB_PASS)
OR die (
"Cannot connect to your database");
mysql_select_db('dogforum') OR die("Cannot connect to your database");

$guests mysql_query("SELECT COUNT(*) FROM session WHERE userid=0");
$row mysql_fetch_row($guests);
$numberguest=$row[0];

$users mysql_query("SELECT COUNT(*) FROM session WHERE userid<>0");
$row mysql_fetch_row($users);
$numberusers=$row[0];

$total_online $numberguest $numberusers;

$query mysql_query("select * from datastore");
$data = array();
while (
$row mysql_fetch_row($query)) {
    
$data[$row[0]] = $row[1];
}

$maxonline unserialize($data['maxloggedin']);
$userstats unserialize($data['userstats']);
?>
HTML Code:
Visitors Online: <strong><?=$total_online;?></strong><br>
Members: <strong><?=$numberusers;?></strong> <br>
Guests: <strong><?=$numberguest;?></strong><br>
Registered users:<strong><?=$userstats['numbermembers'];?></strong><br><br>
Most users online: <b><?=$maxonline['maxonline'];?></b><br>
on <?=date("M jS, Y G:i:s", $maxonline['maxonlinedate']);?>.<br>
Newest member, <b><?=$userstats['newusername'];?></b>
work fine for me... check it out http://www.thedogsite.com/ (top left box)
Reply With Quote
Reply

Thread Tools
Display Modes

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 03:09 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.04066 seconds
  • Memory Usage 2,215KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete