checking if a user is logged in/autologin

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
honest
Registered User
Posts: 38
Joined: Sat Apr 24, 2004 6:09 pm

checking if a user is logged in/autologin

Post by honest »

Hey, I was wondering what I need to include on my homepage to check if the user is logged into the forum/has autologin turned on. What I intend to do is to have the homepage's style match the style chosen in their profile if they are logged in, or just use the default settings.

on a sidenote: how would i go about checking if the user is banned from the forum?
vanda1
Registered User
Posts: 22
Joined: Mon May 10, 2004 7:39 pm

Post by vanda1 »

I would also like to know how to check if i a user is currently logged in with the phpbb session structure
Graham
Former Team Member
Posts: 8462
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK
Contact:

Post by Graham »

The following explains how you can integrate the sessions into pages on your site

http://www.phpbb.com/kb/article.php?article_id=143

If you do this, information about the currently logged in user is available in $userdata

eg $userdata['session_logged_in'] will tell you if they are logged in. It also contains most of the other information about that user from the phpbb_users table
"So Long, and Thanks for All the Fish"

phpBB Useful Links: Knowledge Base | Userguide | Forum Search | MOD Database | Styles Database
My Links: Blog!
honest
Registered User
Posts: 38
Joined: Sat Apr 24, 2004 6:09 pm

Post by honest »

Thank You!

oh, one final question, is there a way to make it so that if the forum/db goes down, the page will just load without the information from the database?
sneakyimp
Registered User
Posts: 162
Joined: Sat Nov 06, 2004 4:50 am
Contact:

Post by sneakyimp »

that session integration tutorial rocks. very useful.

can anyone point me to a more detailed explanation of how the PAGE_INDEX functionality works? I think I understand that when you init your session with this line:

Code: Select all

$userdata = session_pagestart($user_ip, PAGE_INDEX); 
then it tells the other visitors where on the site you are. if you are creating new pages, how might you go about defining new page numbers and giving them names?


EDIT: Never mind, i just found the case statements using the grep. there are switch statements in viewonline.php and admin/index.php
Graham
Former Team Member
Posts: 8462
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK
Contact:

Post by Graham »

"So Long, and Thanks for All the Fish"

phpBB Useful Links: Knowledge Base | Userguide | Forum Search | MOD Database | Styles Database
My Links: Blog!
honest
Registered User
Posts: 38
Joined: Sat Apr 24, 2004 6:09 pm

Post by honest »

Thanks!
Post Reply

Return to “[2.0.x] MOD Writers Discussion”