Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Wednesday, May 22 2013 @ 09:02 AM EDT


 Forum Index > Extensions > Cool Hacks New Topic Post Reply
 making a slicker login
   
Anonymous: Anonymous
 10/02/02 03:34PM (Read 1387 times)  



For those space-conscious designers, I've found a way to put the phrase "username" into the form itself and then disappear once the user selects the form window. Likewise, you can put a few dots inthe password form and everyone knows what's going on. This way you can make a very slick box that doesn't take up so much space.

To see what I mean, go to http://sloy.dns2go.com/

To do it, merely comment out this section of your lib-common.php at around line 1820:
$retval .= COM_startBlock($LANG01[47])
. '<form action="' . $_CONF['site_url'] . '/users.php" method="post">' . LB
. '<b>' . $LANG01[21] . ':</b><br>' . LB
. '<input type="text" size="10" name="loginname" value=""><br>' . LB
. '<b>' . $LANG01[57] . ':</b><br>' . LB
. '<input type="password" size="10" name="passwd"><br>' . LB
. '<input type="submit" value="' . $LANG01[58] . '">' . LB
. '</form>' . $LANG01[59] . LB
. COM_endBlock(COM_getBlockTemplate('user_block', 'footer'));
}


and change it to this code:

$retval .= COM_startBlock($LANG01[47])
. '<p align="right"><form action="' . $_CONF['site_url'] . '/users.php" method="post">' . LB
. '<input type="text" size="10" name="loginname" value="username" infocus="if(this.value==\'username\')this.value=\'\'" inblur="if(this.value==\'\')this.value=\'username\';">' . LB
. '<input type="password" size="8" name="passwd" value="asdfasdf" infocus="if(this.value==\'asdfasdf\')this.value=\'\'" inblur="if(this.value==\'\')this.value=\'asdfasdf\';"><br>' . LB
. "$LANG01[59] " . '<input type="submit" value="' . $LANG01[58] . '"></form></p>'
. COM_endBlock(COM_getBlockTemplate('user_block', 'footer'));
}

As you might notice, it uses javascript. If you're willing to have that requirement on visitors I think this is very useful and would advocate its adoption into the geeklog codebase. I belive I've been a bit lazy here and not included the LANG call above for username, but that should work for non-english users.

 
 Quote
Content generated in: 0.14 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Able to post 
Filtered HTML Allowed 
Censored Content