vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to display currently online users on any normal PHP page (https://vborg.vbsupport.ru/showthread.php?t=187274)

dgeere 08-05-2008 11:56 AM

How to display currently online users on any normal PHP page
 
Hey all.

How can I produce a list of users that are currently online in the forum. I want to then print these out on a normal PHP page that is not part of the vbulletin software. Each name would link to the users profile.

I expect this will need to use javascript although I would prefer to use php to do this so that it is server side processed and prints out static html code.

Any thoughts or help would be great :)

Thanks,
David

Dismounted 08-05-2008 12:03 PM

As stated before in many other threads, you need to replicate what vBulletin does to do this in index.php.

dgeere 08-05-2008 12:05 PM

Think I just replied to you in another thread asking if you could link to one of these other posts or provide more detail as based on your reply I have no idea what you are on about :)

Thanks :)

--------------- Added [DATE]1217943513[/DATE] at [TIME]1217943513[/TIME] ---------------

Quote:

Originally Posted by Dismounted (Post 1591822)
As stated before in many other threads, you need to replicate what vBulletin does to do this in index.php.

I am trying to find those threads. Perhaps you can shed a little more light? I wouldn't be here asking if I knew how to do it. :)

Thank you for your help, I need a little more direction though. Thanks.

Lynne 08-05-2008 02:16 PM

Open up the index.php page. Find and copy the whole section under "// ### LOGGED IN USERS ###" You may have to include a couple of the files listed right below where it says "// ### REQUIRE BACK-END ###"

dgeere 08-05-2008 02:35 PM

Fantastic. Thank you. A much more helpful reply. Think I can sort this now. :)

--------------- Added [DATE]1217962579[/DATE] at [TIME]1217962579[/TIME] ---------------

Having some trouble. The page I want to show the info on is in the root while my forum is in a folder called /forum/ and I get this error

Warning: main(/home/public_html/includes/init.php) [function.main]: failed to open stream: No such file or directory in /home/public_html/forum/global.php on line 20

I edited global.php to include the right path but that then breaks the forum.

Any thoughts on how to load it with the right base path being used etc?

--------------- Added [DATE]1217965242[/DATE] at [TIME]1217965242[/TIME] ---------------

Ok. Got a little further by using



Code:

// ######################### REQUIRE BACK-END ############################
chdir("./forum");
require_once("./global.php");
require_once("./includes/functions_bigthree.php");
require_once("./includes/functions_forumlist.php");
chdir("../");




But now I get
Fatal error: Call to a member function on a non-object in /home/public_html/forum/includes/functions.php on line 1303

--------------- Added [DATE]1217966241[/DATE] at [TIME]1217966241[/TIME] ---------------

Give up. can't get this to work. :(

Alfa1 08-06-2008 01:36 AM

Wouldn't this work?
PHP Code:

// ######################### REQUIRE BACK-END ############################
require_once('./forum/global.php');
require_once(
DIR '/forum/includes/functions_bigthree.php');
require_once(
DIR '/forum/includes/functions_forumlist.php');

// ####################################################################### 


Lynne 08-06-2008 03:44 AM

Get rid of the second chdir.
PHP Code:

// ######################### REQUIRE BACK-END ############################
chdir("./forum");
require_once(
'./global.php');
require_once(
DIR '/includes/functions_bigthree.php');
require_once(
DIR '/includes/functions_forumlist.php'); 


dgeere 08-06-2008 12:30 PM

Just FYI so you know... None of these worked. I have made a custom SQL call instead

Opserty 08-06-2008 12:41 PM

Yeah, all you really need is the query SQL. The rest you can create yourself if you have knowledge of PHP.

Lynne 08-06-2008 02:56 PM

Quote:

Originally Posted by dgeere (Post 1592570)
Just FYI so you know... None of these worked. I have made a custom SQL call instead

Very strange. I copied the code to my page outside the vb forums directory and it works just fine.


All times are GMT. The time now is 11:39 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.01147 seconds
  • Memory Usage 1,737KB
  • 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
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete