Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2004, 03:36 PM
Shari Hes's Avatar
Shari Hes Shari Hes is offline
 
Join Date: Jan 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default who's online on other pages?

hi ^^

I was wondering if there's a way to incorporate the 'who's online' feature on all my php pages. it would be cool to be able to know who's reading our comics ^^

here, my site, http://darkroomfiction.com

** doing big puppy dog's eyes**
Reply With Quote
  #2  
Old 02-16-2004, 04:02 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Include this in all your scripts:
PHP Code:
chdir('./path/to/forum')
require_once(
'./includes/init.php'); 
In functions_online.php FIND
PHP Code:
case 'bugs.php':
        
$userinfo['activity'] = 'bugs';
        break; 
Below that add sections like this for all your scripts (changing the script & activity name of course).

Also in functions_online.php FIND
PHP Code:
case 'bugs':
        
$userinfo['action'] = construct_phrase($vbphrase['viewing_x'], 'Bugs'); 
        break; 
Below that add a sections like this for all your scripts (changing activity name and text of course).
Reply With Quote
  #3  
Old 02-16-2004, 04:57 PM
Shari Hes's Avatar
Shari Hes Shari Hes is offline
 
Join Date: Jan 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
Include this in all your scripts:
PHP Code:
chdir'./path/to/forum')
require_once(
'./includes/init.php'); 
In functions_online.php FIND
PHP Code:
case 'bugs.php':
        
$userinfo['activity'] = 'bugs';
        break; 
Below that add sections like this for all your scripts (changing the script & activity name of course).

Also in functions_online.php FIND
PHP Code:
case 'bugs':
        
$userinfo['action'] = construct_phrase($vbphrase['viewing_x'], 'Bugs'); 
        break; 
Below that add a sections like this for all your scripts (changing activity name and text of course).
wow, Thanks ^^

that will show what's people doing on online.php right? how can I also show who's on each pages like in showthread as well?
Reply With Quote
  #4  
Old 02-16-2004, 06:23 PM
Shari Hes's Avatar
Shari Hes Shari Hes is offline
 
Join Date: Jan 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm.. I just tried it and (after fixing chdir typo and placing it in an area where it didn't affect any of my other include scripts) it didn't work.

I visit the who's online section and nothing comes up about people viewing the default index.php home page in the root dir.

am I not doing something right?
Reply With Quote
  #5  
Old 02-16-2004, 06:42 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm ...

Does it work if you use
require_once('./global.php');

instead of init.php?
?
Reply With Quote
  #6  
Old 02-16-2004, 08:50 PM
Shari Hes's Avatar
Shari Hes Shari Hes is offline
 
Join Date: Jan 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That worked ^_^

I also noticed some other things too. I did some 'static' coding into the file to get it to recognise all my pages properly, as the original version only recognises the 'filenames', not the full path or data that comes with the url after the '?'.

Thanks a bunch for your help! Really appreciate it.
Reply With Quote
  #7  
Old 02-16-2004, 08:57 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Shari Hes
I also noticed some other things too. I did some 'static' coding into the file to get it to recognise all my pages properly, as the original version only recognises the 'filenames', not the full path or data that comes with the url after the '?'.
Hmm ... there is code in functions_online.php to only use the filename, so the path should not be necessary.
If you want to display more detailed information about where your visitors are (eg. based on some specific parameters) this will become a bit more tricky ...
So if you want this send me a PM with some more details (eg. filenames, parameters, etc) and i'll see what I can do for you.
Reply With Quote
  #8  
Old 02-17-2004, 12:41 PM
Shari Hes's Avatar
Shari Hes Shari Hes is offline
 
Join Date: Jan 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the offer, but managed to get it working finally.

Did some tweaking and some experimenting and managed to get it to do exactly what I wanted. See, I needed it to recognise the full path, otherwise, the script got confused.

My index page at the root of my site is index.php and that handles all my site pages for me (data parsed to it via the url). So, by only passing the filename, the script couldn't tell the difference between index.php in my root folder and index.php in my forum folder.

But using some if statements inside the index case and using the userinfo[location] array, I was able to get it to direct the activity to the right cases.

But I couldn't have done it without your code. I didn't even know where to start, so again, thanks a bunch

PS. just to let you know, the first message was posted by Shari herself, but the rest were posted by me, Fred, the dude who does the coding on our sites ^_~ I just didn't have my own login for this forum.
Reply With Quote
  #9  
Old 06-17-2005, 01:27 AM
nonet nonet is offline
 
Join Date: Jul 2004
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work for pages that are located on another domain?
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 11:15 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.05273 seconds
  • Memory Usage 2,253KB
  • 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
  • (6)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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