vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   include the $loggedinusers on a non VB page? (https://vborg.vbsupport.ru/showthread.php?t=6196)

01-01-2001 09:19 PM

I would like to include the $loggedinusers on a non VB page.

I assume that writing this data to a TXT file (and inserting it via SSI) everytime this data is modified would be a PAIN for the server as it may change several times per second when traffic is high... SO... what do you suggest?

Any of you guys could help?

I think that several peopel are trying to integrate vBulletin to sites as much as possible... I think that designwise it is the BEST board (onlineDJ.com looks great with the board, perfect integration) but it would be great to have an easy step by step help to show data to non VB pages, and to easily use the login of the board to other parts of the site.

01-01-2001 10:29 PM

this goes back to asking for a few include files to be made by the developers. would be nice.

ManoOne, the only ways to do it are 1) use an include or 2) have the page a .php page with a direct call to the mySQL database quering number of online users. Up to you which you do, as an include file is basically exactly the same i would not think there is much of a performance difference.

01-01-2001 10:50 PM

interesting

what would be the PHP code to add to the page (i can set th ephp extension to it) in order to grab those numbers from the database and display them?

thanks

01-01-2001 11:09 PM

not sure but it will be the same as the bit on index.php so it is probably in there somewhere.

01-02-2001 01:16 AM

THANK YOU SO MUCH!

http://www.onlinedj.com

Look, the frontpage of the site! Users are logged in once they enter the domain, etc. etc..

excellent, thanks again

01-02-2001 05:42 AM

I would also like to show who is on the board form my home page. It would be no biggie for me o make it a php page.

Can you please explain how to do it.

Thanks!

01-02-2001 08:52 AM

i am not sure, this may work:


Code:

  $datecut=time()-$cookietimeout;
    $loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session");
    $totalonline=$loggedins[sessions];
    $loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid=0");
    $numberguest=$loggedins[sessions];
    $loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid<>0");
    $numberregistered=$loggedins[sessions];

    $numbervisible=0;
    $loggedins=$DB_site->query("SELECT DISTINCT user.userid,username,session.location FROM user,session WHERE session.userid=user.userid AND session.userid<>0 AND invisible=0 ORDER BY username");
    if ($loggedin=$DB_site->fetch_array($loggedins)) {
      $numbervisible++;
      $userid=$loggedin[userid];
      $username=$loggedin[username];
      $location=$loggedin[location];

      eval("\$activeusers .= \"".gettemplate("loggedinuser")."\";");

      while ($loggedin=$DB_site->fetch_array($loggedins)) {
        $numbervisible++;
        $userid=$loggedin[userid];
        $username=$loggedin[username];
        $location=$loggedin[location];
        eval("\$activeusers .= \", ".gettemplate("loggedinuser")."\";");
    }
    }
    $numberinvisible=$numberregistered-$numbervisible;
    eval("\$loggedinusers = \"".gettemplate("loggedinusers")."\";");

but then you will have to add this at the top

require("global.php");

it will also mean people on that page will be counted in the online stats

01-02-2001 10:09 AM

ManoOne

can you post your coding?

01-02-2001 04:21 PM

ManoOne, glad you got it working and glad i could help.

Mental Stamina, is must be something like what i posted because that is what i suggested to ManoOne who got it to work, the section you want is in index.php just make sure you require global.php at the top. try it it may well work :)

01-02-2001 08:37 PM

Guys.. I almost have it working I guess..
Here is the thing.. It dosent display..I viewed sorce..and the code stops at the

<?php

require("global.php");

?>

Hmm what do you think is happening?

I am calling this page:

http://www.clubfreestyle.com/testwho.php

Any ideas?


All times are GMT. The time now is 02:43 PM.

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.01077 seconds
  • Memory Usage 1,736KB
  • 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_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete