Customize log in log out button

All style (template, theme and imageset) related questions for the new release; advice, feedback here please.
Post Reply
stonedeft
Registered User
Posts: 2
Joined: Thu Mar 12, 2009 4:16 pm

Customize log in log out button

Post by stonedeft »

Hello Community!

I like to customized the log in log out button of my whole board, something like:

when a user is not logged in it will say "welcome guest please log in " and when the user is logged in it will say "Welcome back user".

In vbulletin you edit the phrases to achieve this how about in phpbb where will I edit to achieve this. I know php I just wanted to know the file or database table to edit to get me on the track.

Tnx in advance

User avatar
stickerboy
Registered User
Posts: 94
Joined: Fri Jun 04, 2004 3:05 pm
Location: Airdrie, UK
Contact:

Re: Customize log in log out button

Post by stickerboy »

This code in includes/functions.php is where the message is set:

Code: Select all

    // Generate logged in/logged out status
    if ($user->data['user_id'] != ANONYMOUS)
    {
        $u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id);
        $l_login_logout = sprintf($user->lang['LOGOUT_USER'], $user->data['username']);
    }
    else
    {
        $u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login');
        $l_login_logout = $user->lang['LOGIN'];
    } 
Specifically the $user->lang. If you look in langauge/en/common.php - you'll find those values and can change them there to what you wish :)
I'm a web-designing prototyping tech-support musician
|| Twitter || Flickr || BandCamp ||
Please don't contact me via pm/email unless I ask you to/say it's ok

stonedeft
Registered User
Posts: 2
Joined: Thu Mar 12, 2009 4:16 pm

Re: Customize log in log out button

Post by stonedeft »

Wow thanx you look good !!

Uhmm I want to take it a step higher I want to display the user avatar next to the log out button. I want to query the database for the user's avatar. Question: what string variable is holding the user name? is that $user->data['username'] ?

Will I query the database like so:

SELECT * FROM table WHERE table_column = $user->data['username']

I hanvn't figured it out yet where to query but I'll get to that...

OR

what file in phpbb is displaying the avatar maybe I can just use it than going out of my way reinventing the wheel.

Tnx again.

Post Reply