[MOD] Digg like AJAX login on top of the page!!

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-26-2007, 02:17 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
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
  #2 (permalink)  
Old 06-26-2007, 05:56 AM
Constant Pligger
 
Join Date: Jun 2006
Posts: 108
Thanks dollar

awesome

noyP
Reply With Quote
  #3 (permalink)  
Old 06-26-2007, 06:29 AM
New Pligger
 
Join Date: Jun 2007
Posts: 2
Thank you very much
Reply With Quote
  #4 (permalink)  
Old 06-26-2007, 11:47 AM
Constant Pligger
Pligg Version: 1.1.3
 
Join Date: Oct 2006
Posts: 191
Thanks dollar5. I got it working and customised on my site.

I got to load below instead on the top. It works perfectly fine in FF. However in IE 6 when the login form loads, it kind of hides the breadcrumb and sort options. when toggled to hide the login form the breadcrumb and sort option shows up.

Cheers

My Pligg Sites: startupbug.com

Last edited by PurpleCow; 06-26-2007 at 11:51 AM.
Reply With Quote
  #5 (permalink)  
Old 06-26-2007, 12:06 PM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
Not sure - but it works fine on all browsers as far as I tested (might be some CSS issues)
Reply With Quote
  #6 (permalink)  
Old 06-27-2007, 08:08 PM
Casual Pligger
 
Join Date: Mar 2007
Posts: 51
Quote:
Originally Posted by dollars5 View Post
Not sure - but it works fine on all browsers as far as I tested (might be some CSS issues)
Thanks Dollar5 for this useful code, I implemented it successfully on my pligg site:

http://elquiosco.net

Reply With Quote
  #7 (permalink)  
Old 06-28-2007, 02:39 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 1,960
Glad to many using it. We have a commerical version of it with more customizations too.
Reply With Quote
  #8 (permalink)  
Old 07-10-2007, 09:17 AM
Donor
 
Join Date: Jun 2007
Posts: 289
Great work!!
Reply With Quote
  #9 (permalink)  
Old 07-11-2007, 06:08 PM
jrothra's Avatar
Constant Pligger
Pligg Version: 9.9.5
Pligg Template: Silverbullet
 
Join Date: Apr 2007
Location: Fort Worth, TX
Posts: 179
I'm using Pligg Beta 9.7. I put this code in and noticed that it works in IE7 and not Firefox 2.0.0.4.

FaithTag / Published News

Found the problem... had the logo div set to float left... changed float:left; to text-align:left;

Last edited by jrothra; 07-11-2007 at 06:12 PM.
Reply With Quote
  #10 (permalink)  
Old 07-12-2007, 05:40 PM
New Pligger
 
Join Date: May 2007
Posts: 2
thanks very good
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Variables Yankidank Wiki Articles 3 05-19-2011 09:21 AM
How to make a Digg-style FAQ page with JavaScript and jQuery mendim Questions and Comments 25 09-14-2010 12:27 AM
[MOD] Categories in header like Digg (useful if you have subcategories) dollars5 Questions and Comments 142 06-01-2009 09:24 AM
Login and refresh page problems sanmi1234 Questions and Comments 3 07-15-2007 05:25 PM
[SOLVED] Digg like Ajax login PurpleCow Questions and Comments 7 06-26-2007 02:18 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development