Log in

View Full Version : Logged in status on non-forum page


BahBah
06-01-2005, 09:12 PM
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
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
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
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?