Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-26-2007, 01:17 AM
dollars5's Avatar
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
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
The Following 5 Users Say Thank You to dollars5 For This Useful Post:
  #2 (permalink)  
Old 06-26-2007, 04:56 AM
Constant Pligger
 
Join Date: Jun 2006
Posts: 109
Thanks: 75
Thanked 1 Time in 1 Post
Thanks dollar

awesome

noyP
Reply With Quote
  #3 (permalink)  
Old 06-26-2007, 05:29 AM
New Pligger
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
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: 136
Thanks: 5
Thanked 0 Times in 0 Posts
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 is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
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
Thanks: 11
Thanked 5 Times in 3 Posts
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 is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
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
New Pligger
 
Join Date: Jun 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Great work!!
__________________
http://www.techkr.com
Reply With Quote
  #9 (permalink)  
Old 07-11-2007, 05:08 PM
Constant Pligger
Pligg Version: 9.7 - updating is a MAJOR task
Pligg Template: Custom - complete redesign needed to update
 
Join Date: Apr 2007
Posts: 155
Thanks: 19
Thanked 2 Times in 2 Posts
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: 0
Thanked 0 Times in 0 Posts
thanks very good
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
[MOD] Categories in header like Digg (useful if you have subcategories) dollars5 Modification Tutorials 139 10-19-2008 10:58 AM
Page Variables Yankidank Wiki Articles 1 08-13-2008 03:59 AM
admin_index.php is a blank page and after submiting user login form - blank. mosko General Help 5 11-09-2007 10:32 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


Search Engine Friendly URLs by vBSEO 3.2.0