Change "Log out" Text (Simple mod I think)

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
Neon_
Registered User
Posts: 79
Joined: Wed Jul 26, 2006 2:50 am

Change "Log out" Text (Simple mod I think)

Post by Neon_ »

I wanna change the text
"Log out [Username]"
to
"You are logged in as username [Log out]"
But only have the words "Log out" as a link.
Last edited by Neon_ on Mon Jul 31, 2006 6:41 pm, edited 1 time in total.
klarinetking
Registered User
Posts: 44
Joined: Wed Jul 26, 2006 4:37 am
Contact:

Post by klarinetking »

Hi,

You don't need a MOD for this.

You just need to search in the language files for that string and change it.

klarinetking
Neon_
Registered User
Posts: 79
Joined: Wed Jul 26, 2006 2:50 am

Post by Neon_ »

But that would just change the text, wouldn't it? I wanna make it so only "Log out" is a link.
StijnH
Registered User
Posts: 65
Joined: Sun Jul 30, 2006 10:53 am
Location: Roeselare, West-Vlaanderen, Belgium

Post by StijnH »

Then you need to edit your language file and your template file
Neon_
Registered User
Posts: 79
Joined: Wed Jul 26, 2006 2:50 am

Post by Neon_ »

Yeah I got both open, Im trying to figure it out. I'm not that good w/ php.
If someone could just supply the code or something and I could learn offa that It would be nice.
Neon_
Registered User
Posts: 79
Joined: Wed Jul 26, 2006 2:50 am

Post by Neon_ »

Anyone?
StijnH
Registered User
Posts: 65
Joined: Sun Jul 30, 2006 10:53 am
Location: Roeselare, West-Vlaanderen, Belgium

Post by StijnH »

kk i'll have a look (for subsilver only :) )
Neon_
Registered User
Posts: 79
Joined: Wed Jul 26, 2006 2:50 am

Post by Neon_ »

Yeah thnx man. Subsilvers what I'm using anyway, just modding it up ALOT. I can figure out how to tweak it to my mods if needed.
StijnH
Registered User
Posts: 65
Joined: Sun Jul 30, 2006 10:53 am
Location: Roeselare, West-Vlaanderen, Belgium

Post by StijnH »

sorry but it'll be for tomorrow
going to bed now, gotta work tomorrow (doing a vacation job in a theme park :D )
i think that it wont mather if it takes a day longer?
Neon_
Registered User
Posts: 79
Joined: Wed Jul 26, 2006 2:50 am

Post by Neon_ »

Naw man I can work on other stuff in the mean time. But yeah I gotta get everything done for monday at the very latest.
User avatar
camm15h
Former Team Member
Posts: 4981
Joined: Wed Jul 30, 2003 1:02 am
Location: Hull, UK
Name: Paul Cammish

Post by camm15h »

includes/page_header.php around line 76:

Code: Select all

//
// Generate logged in/logged out status
//
if ( $userdata['session_logged_in'] )
{
	$u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id'];
	$l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';
}
Neon_
Registered User
Posts: 79
Joined: Wed Jul 26, 2006 2:50 am

Post by Neon_ »

Thanks camm, used that n got it sorted out. StijnH, no need for you to help me w/ this anymore, got it on my own (er sorta). Thanks anyways.

I modded that code into:

Code: Select all

	$u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id'];
	$l_login_logout = $lang['Logout'];
and added this in later on down the page:

Code: Select all

if ($userdata['user_id'] != '-1')
	{
		$my_user_log = $userdata['username'];
	}
And put this as my code for displaying it in overall_header.tpl:

Code: Select all

<!-- BEGIN switch_user_logged_in -->
Logged in as {MY_USER_LOG} [
<!-- END switch_user_logged_in -->
<a href="{U_LOGIN_LOGOUT}" class="mainmenu">{L_LOGIN_LOGOUT}</a></span>
<!-- BEGIN switch_user_logged_in -->
]
<!-- END switch_user_logged_in -->
deejaybet
Registered User
Posts: 1814
Joined: Thu Dec 08, 2005 2:01 pm
Location: Derry, Northern Ireland
Contact:

Post by deejaybet »

do you have better instructions for that?
Neon_
Registered User
Posts: 79
Joined: Wed Jul 26, 2006 2:50 am

Post by Neon_ »

um sure but gimme a sec, im learning how all this works a bit better now and im gunna clean up the code a bit 1st. Mostly just to get rid of 3 unessesary spaces.
Neon_
Registered User
Posts: 79
Joined: Wed Jul 26, 2006 2:50 am

Post by Neon_ »

This code will display the text as follows anywhere in your page header (where the parts in blue are replace with the name of the user that is logged in, and the parts in green are links:

When logged in:
Logged in as username [Log out]


When logged out:
Register | Log in


Open up page_header.php

Find:

Code: Select all

// 
// Generate logged in/logged out status 
// 
if ( $userdata['session_logged_in'] ) 
{ 
   $u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id']; 
   $l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]'; 
}
Replace with:

Code: Select all

//
// Generate logged in/logged out status
//
if ( $userdata['session_logged_in'] )
{
	$u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id'];
	$l_login_logout = $lang['Logout'];
}
Find:

Code: Select all

// Format Timezone. We are unable to use array_pop here, because of PHP3 compatibility
Before, Add:

Code: Select all

// Logged As - Neon_
if ($userdata['user_id'] != '-1')
{
	$my_user_log = $userdata['username'];
}
Now open up overall_header.tpl and paste the following code whever you want it to be displayed:

Code: Select all

<!-- BEGIN switch_user_logged_out -->
<a href="{U_REGISTER}" class="mainmenu">{L_REGISTER}</a>&nbsp;|&nbsp;
<a href="{U_LOGIN_LOGOUT}" class="mainmenu">{L_LOGIN_LOGOUT}</a>
<!-- END switch_user_logged_out -->
<!-- BEGIN switch_user_logged_in -->
Logged in as {MY_USER_LOG} [<a href="{U_LOGIN_LOGOUT}" class="mainmenu">{L_LOGIN_LOGOUT}</a>]
<!-- END switch_user_logged_in -->
Post Reply

Return to “[2.0.x] MOD Requests”