vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   User(+Forum?)Stats on a NON-VB Page! (https://vborg.vbsupport.ru/showthread.php?t=67186)

Jack28 07-15-2004 12:51 AM

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

Jack28 07-17-2004 01:14 AM

bump

Andreas 07-17-2004 01:51 AM

[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.

Jack28 07-17-2004 01:42 PM

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

do i need to use includes n stuff?

mchaos 02-07-2006 03:26 AM

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...

virtualraceday 02-09-2006 01:34 PM

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)


All times are GMT. The time now is 12:34 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01083 seconds
  • Memory Usage 1,733KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete