Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2008, 11:56 AM
dgeere dgeere is offline
 
Join Date: Nov 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 08-05-2008, 12:03 PM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As stated before in many other threads, you need to replicate what vBulletin does to do this in index.php.
Reply With Quote
  #3  
Old 08-05-2008, 12:05 PM
dgeere dgeere is offline
 
Join Date: Nov 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 View Post
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.
Reply With Quote
  #4  
Old 08-05-2008, 02:16 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ###"
Reply With Quote
  #5  
Old 08-05-2008, 02:35 PM
dgeere dgeere is offline
 
Join Date: Nov 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 08-06-2008, 01:36 AM
Alfa1's Avatar
Alfa1 Alfa1 is offline
 
Join Date: Dec 2005
Location: Netherlands
Posts: 3,537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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');

// ####################################################################### 
Reply With Quote
  #7  
Old 08-06-2008, 03:44 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'); 
Reply With Quote
  #8  
Old 08-06-2008, 12:30 PM
dgeere dgeere is offline
 
Join Date: Nov 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just FYI so you know... None of these worked. I have made a custom SQL call instead
Reply With Quote
  #9  
Old 08-06-2008, 12:41 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, all you really need is the query SQL. The rest you can create yourself if you have knowledge of PHP.
Reply With Quote
  #10  
Old 08-06-2008, 02:56 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dgeere View Post
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.
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 10:52 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.03995 seconds
  • Memory Usage 2,255KB
  • Queries Executed 13 (?)
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_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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