View Single Post
  #1 (permalink)  
Old 06-26-2007, 01:17 AM
dollars5's Avatar
dollars5 dollars5 is offline
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,961
People are so wanting for this, here it comes:

Add the following code below the line 1 with {config_load file="/libs/lang.conf"} in file /templates/yget/header.tpl

Code:
<div id="login_form" style="display:none;">
 <form action="{$my_base_url}{$my_pligg_base}/login.php" method="post" id="login_form">
 Username:
  <input type="text" name="username" size="25" tabindex="1" id="uname" value="" />
  Password:
 <input type="password" name="password" id="upassword" size="25" tabindex="2"/>
 Remember: <input type="checkbox" name="persistent" id="uremember" tabindex="3"/>
  <input type="submit" value="Login" class="log2" tabindex="4" />
  <input type="hidden" name="processlogin" value="1" />
 </form>
</div>

<div id="headbar" style="padding-bottom:2px;">
		{if $user_authenticated eq true}
			{*{#PLIGG_Visual_Welcome_Back#}<img src="{$Current_User_Avatar_ImgSrc}" alt="Avatar" align="absmiddle"/>*} <a href="{$URL_userNoVar}">{$user_logged_in}</a> |
			{if $isadmin eq 1} <a href="{$URL_admin}"> {#PLIGG_Visual_Header_AdminPanel#}</a> | {/if}		
			<a href="{$URL_logout}"> {#PLIGG_Visual_Logout#}</a>
		{else}
			<a href="javascript:Effect.toggle('login_form','appear');">{#PLIGG_Visual_Login_Title#}</a> |
			<a href='{$URL_register}'>{#PLIGG_Visual_Register#}</a> &nbsp;&nbsp;
		{/if}
</div>
So it will present login | register links to un-registered users, once logged in - the text will change to welcome user | logout

use proper CSS to align it as needed for your setup.

This can be seen live at http://memeorlame.com site

Illustrations are presented below:
unregistered user:


user clicks the login link to get the ajax drop-down:


after logged in:


If you need more advanced and customized version of the script, feel free to contact us.
Reply With Quote