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 06-01-2005, 09:12 PM
BahBah BahBah is offline
 
Join Date: Jun 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Logged in status on non-forum page

Hi,

I hope you can help!

I have been looking for a modification ever since having vb (about 4 years now) that will enable me to show whether a user is logged in or not on a non-vbulletin page.

So it will welcome them if they are logged in, and suggest they register if they are not logged in.

Something like this has to already exist as its such a cool but relatively basic thing to do (I imagine).

Can anyone enlighten me about this ?

Thank you
Reply With Quote
  #2  
Old 06-03-2005, 05:19 PM
BahBah BahBah is offline
 
Join Date: Jun 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BahBah
Hi,

I hope you can help!

I have been looking for a modification ever since having vb (about 4 years now) that will enable me to show whether a user is logged in or not on a non-vbulletin page.

So it will welcome them if they are logged in, and suggest they register if they are not logged in.

Something like this has to already exist as its such a cool but relatively basic thing to do (I imagine).

Can anyone enlighten me about this ?

Thank you
Anyone ?
Reply With Quote
  #3  
Old 06-03-2005, 05:24 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You will have to query the session table for that i think, and then check if lastactivity is more then TIMENOW - cookietimeout
Reply With Quote
  #4  
Old 06-03-2005, 06:19 PM
BahBah BahBah is offline
 
Join Date: Jun 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
You will have to query the session table for that i think, and then check if lastactivity is more then TIMENOW - cookietimeout
I have found a way to now establish whether a user is on or offline and then display a welcome or login box.

Is there any way to avoid having to chdir to use the global.php file ?

I'm thinking of the necessity to do this:

<?
chdir('/forum/path/');
require_once('global.php');
?>

If I chdir the rest of my scripts break
Reply With Quote
  #5  
Old 06-03-2005, 06:36 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is no way around that chdir. You might need to chdir back after global.php.
Reply With Quote
  #6  
Old 07-17-2005, 02:01 PM
bulbasnore bulbasnore is offline
 
Join Date: Dec 2004
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can't set a path or call global.php with its full path? Pardon the ignorance of my question -- I'm not suggesting an alternative, just looking for why chdir is required.
Reply With Quote
  #7  
Old 07-17-2005, 02:06 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In vB version 3.0.x (this has changed in 3.5) all includes that are called from global.php, are using a relative path to the current working directory. That is why fully qualifying global.php will not work, but a chdir to the forumhome before calling global.php does work.
Reply With Quote
  #8  
Old 07-17-2005, 02:46 PM
bulbasnore bulbasnore is offline
 
Join Date: Dec 2004
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Marco, thanks for making me smarter about this. I suppose it changes for the better in 3.5. I'm actually coding some tests using chdir right now; I'm hoping that global.php doesn't clear my form variables. Cheers.

edit:Yep. Completely wipes out the form submission (http_post_vars) when I authenticate the target of the form action.

This becomes really byzantine, I'm vb authenticating the dynamically loaded input form just fine by loading global.php before my other requires. I guess at that point I have to set my own cookie to be checked by the target of the submission? Is there a better way?
Reply With Quote
  #9  
Old 08-27-2005, 02:48 AM
mfarmerhi mfarmerhi is offline
 
Join Date: Apr 2003
Posts: 74
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bulbasnore
Marco, thanks for making me smarter about this. I suppose it changes for the better in 3.5. I'm actually coding some tests using chdir right now; I'm hoping that global.php doesn't clear my form variables. Cheers.

edit:Yep. Completely wipes out the form submission (http_post_vars) when I authenticate the target of the form action.

This becomes really byzantine, I'm vb authenticating the dynamically loaded input form just fine by loading global.php before my other requires. I guess at that point I have to set my own cookie to be checked by the target of the submission? Is there a better way?
Anyone have a solution to this? I'm looking too.

I'd like to use only some of the global values, WITHOUT calling global.php (because it wipes out my other apps variables).

I only need a few template globals and whether the user is a Member...

Any solution without calling global.php?
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 02:20 AM.


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.04229 seconds
  • Memory Usage 2,237KB
  • 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
  • (3)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