vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Logged in status on non-forum page (https://vborg.vbsupport.ru/showthread.php?t=82363)

BahBah 06-01-2005 09:12 PM

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

BahBah 06-03-2005 05:19 PM

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 ?

Marco van Herwaarden 06-03-2005 05:24 PM

You will have to query the session table for that i think, and then check if lastactivity is more then TIMENOW - cookietimeout

BahBah 06-03-2005 06:19 PM

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

Marco van Herwaarden 06-03-2005 06:36 PM

There is no way around that chdir. You might need to chdir back after global.php.

bulbasnore 07-17-2005 02:01 PM

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.

Marco van Herwaarden 07-17-2005 02:06 PM

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.

bulbasnore 07-17-2005 02:46 PM

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?

mfarmerhi 08-27-2005 02:48 AM

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?


All times are GMT. The time now is 04:59 AM.

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.01137 seconds
  • Memory Usage 1,732KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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