forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: rbaby on June 08, 2005, 12:04:04 am

Title: Login Box
Post by: rbaby on June 08, 2005, 12:04:04 am
Hey guys,  I made a login box in my template...this box is universal to the site and is the only place where people can log on.  How do I change this to make the box show something else when the user is ALREADY signed on?  As it stands right now, the box does *not* go away even after you log on...I would like it to just say "you are already logged in USER_NAME" and a link to "logout".  Thanks guys.
Title: Re: Login Box
Post by: Joachim Müller on June 08, 2005, 06:58:23 am
Code: [Select]
<?php
if (USER_ID) {
    echo 
'You are already logged in';
} else {
    
// display your login box here
}
?>
Title: Re: Login Box
Post by: Nibbler on June 08, 2005, 04:42:23 pm
You'll need to convert the login box to a proper custom header if you need dynamic behaviour. You would of course need to escape single quotes properly too ;)
Title: Re: Login Box
Post by: LilDog on July 09, 2005, 05:17:03 am
I would like to do something similar to this, utilizing VBulletin's login.

I can put the following code on the template.html and it will properly log the user in. However I would like to replace the current "Login" text in the {MAIN_MENU}field so that the login box will disappear when the user is logged in. Where do I find the {MAIN_MENU} code?

Here is the VBullein login box code that want to use:

Code: [Select]
<!-- login form -->
<form action="/forum/login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
<script type="text/javascript" src="clientscript/vbulletin_md5.js"></script>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td class="smallfont">User Name</td>
<td><input type="text" class="button" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="1" value="User Name" onfocus="if (this.value == 'User Name') this.value = '';" /></td>
<td class="smallfont" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />Remember Me?</label></td>
</tr>
<tr>
<td class="smallfont">Password</td>
<td><input type="password" class="button" name="vb_login_password" size="10" accesskey="p" tabindex="2" /></td>
<td><input type="submit" class="button" value="Log in" tabindex="4" title="Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself." accesskey="s" /></td>
</tr>
</table>
<input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="login" />
<input type="hidden" name="forceredirect" value="1" />
<input type="hidden" name="vb_login_md5password" />
<input type="hidden" name="vb_login_md5password_utf" />
</form>
<!-- / login form -->

If anyone could give me some assistance here, it would be MUCH appreciated! Thanks!