Pligg CMS Forums


Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials



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

Advanced Tutorials for Modifying your Pligg site


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-26-2007, 01:17 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 2,157
Thumbs up [MOD] Digg like AJAX login on top of the page!!

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
Sponsor
  #2 (permalink)  
Old 06-26-2007, 04:56 AM
Constant Pligger
 
Join Date: Jun 2006
Posts: 109
Thanks dollar

awesome

noyP
Reply With Quote
  #3 (permalink)  
Old 06-26-2007, 05:29 AM
New Pligger
 
Join Date: Jun 2007
Posts: 2
Talking Thank you

Thank you very much
Reply With Quote
  #4 (permalink)  
Old 06-26-2007, 10:47 AM
Constant Pligger
 
Join Date: Oct 2006
Posts: 142
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

www.StartupBug.com : User submitted content for Entrepreneurs
www.tutoriALLs.com : ALL the user submitted tutoriALls in one place

Last edited by PurpleCow; 06-26-2007 at 10:51 AM.
Reply With Quote
  #5 (permalink)  
Old 06-26-2007, 11:06 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 2,157
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, 07:08 PM
Casual Pligger
 
Join Date: Mar 2007
Posts: 54
Digg-like login works fine on all browsers

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, 01:39 AM
dollars5's Avatar
Pligg Donor
 
Join Date: Dec 2006
Location: India
Posts: 2,157
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, 08:17 AM
Donor
Donation Level 2 
 
Join Date: Jun 2007
Posts: 284
Great work!!

Buy Now Pligga - The Exclusive Pligg 1.0 Template With! Extra Styles Support Pligg 1.0 Finaltechkr
Reply With Quote
  #9 (permalink)  
Old 07-11-2007, 05:08 PM
jrothra's Avatar
Constant Pligger
Pligg Version: 9.9.5
Pligg Template: Silverbullet
 
Join Date: Apr 2007
Location: Fort Worth, TX
Posts: 184
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 05:12 PM.
Reply With Quote
  #10 (permalink)  
Old 07-12-2007, 04: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
[MOD] Categories in header like Digg (useful if you have subcategories) dollars5 Modification Tutorials 142 06-01-2009 08:24 AM
admin_index.php is a blank page and after submiting user login form - blank. mosko General Help 6 12-30-2008 09:25 PM
Page Variables Yankidank Wiki Articles 1 08-13-2008 03:59 AM
Login and refresh page problems sanmi1234 General Help 3 07-15-2007 04:25 PM
[SOLVED] Digg like Ajax login PurpleCow Modification Tutorials 7 06-26-2007 01:18 AM

Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Use the coupon code PLIGG at Dreamhost.com to receive a discount of up to $84.00 Make a donation to support Pligg CMS development