Custom Search
Web CMS Drupal ConfigurationWeb Page, CMS Technology and Drupal Related Configuration Article |
|
Custom Search
Popular contentToday's:
TopicsRecent comments
|
Customize User Login Block for Drupal 5.1![]() The code below is to make customize user login block for drupal 5.1. This is the sample code, you can customize this code to better suit your site configuration :-). <?php global $user; ?> <?php if ($user->uid) : ?> <span class="login_text">Welcome, </span> <?php print ($user->name); ?> <br> <?php print l("Your Account",'user/'.$user->uid); ?> | <?php print l("Log-Out","logout"); ?> <?php else : ?> <form action="/user" method="post" id="user-login-form"> Username: <input type="text" maxlength="60" name="name" id="edit-name" size="15" value="" tabindex="1" class="form-text required" /> <br> Password: <input type="password" name="pass" id="edit-pass" size="15" tabindex="2" class="form-text required" /> <br> <input type="submit" name="op" id="edit-submit" value="Log in" tabindex="3" class="form-submit" /> <br> <a href="/drupal/?q=user/register" title="Create account">Create account</a> <br> <a href="/drupal/?q=user/password" title="Retrieve lost password">Retrieve lost password</a> <input type="hidden" name="form_id" id="edit-user-login" value="user_login" /> </form> <?php endif; ?> This article derrived from the "Customize drupal user login block" for Drupal version 4.7. »
Custom Search
|
login and stick on current page.
testing code:
this code may be usefull if you want your user log in and stay on current page. change this code:
<form action="/user" method="post" id="user-login-form">
to:
 <form action="/user?<?php print drupal_get_destination() ?>" method="post" id="user-login-form">
Complete Code after modification:
 <?php global $user; ?>
<?php if ($user->uid) : ?>
<span class="login_text">Welcome, </span> <?php print ($user->name); ?> <br>
<?php print l("Your Account",'user/'.$user->uid); ?> |
<?php print l("Log-Out","logout"); ?>
<?php else : ?>
<form action="/user?<?php print drupal_get_destination() ?>" method="post" id="user-login-form">
Username:
<input type="text" maxlength="60" name="name" id="edit-name" size="15" value="" tabindex="1" class="form-text required" />
<br>
Password:
<input type="password" name="pass" id="edit-pass" size="15" tabindex="2" class="form-text required" />
<br>
<input type="submit" name="op" id="edit-submit" value="Log in" tabindex="3" class="form-submit" />
<br>
<a href="/drupal/?q=user/register" title="Create account">Create account</a>
<br>
<a href="/drupal/?q=user/password" title="Retrieve lost password">Retrieve lost password</a>
<input type="hidden" name="form_id" id="edit-user-login" value="user_login" />
</form>
<?php endif; ?>
Drupal 5 custom login block example
the example of working drupal login block on drupal 5.x...
Working example for Login Block Drupal 5.x
want to see the working example of the log in block...
figure 1. before you key in login name and password...
Â
figure 2. after you log in on the drupal system.Â
Â
 see on top of this site you will see the current example.
Personal touch
I just add my personal touch as I had to figure out how to customize it with my CSS template. Plus, I added the $base_url variable not to be depending on the root location of the website.
Hope it helps.
Here is the code:
<?php global $user, $base_url; ?>
<?php if ($user->uid) : ?>
<span class="login_text">Welcome </span> <?php print ($user->name); ?> <br>
<?php print l("My account",'user/'.$user->uid); ?> |
<?php print l("Log out","logout"); ?>
<?php else : ?>
<form action="<?php echo $base_url; ?>/user?<?php print drupal_get_destination() ?>" method="post" id="user-login-form">
<div class="login_form_label">Username:</div>
<input type="text" name="name" id="edit-name" size="15" maxlength="12" value="" tabindex="1" class="login_input" />
<div class="login_form_label">Password:</div>
<input type="password" name="pass" id="edit-pass" size="15" maxlength="12" tabindex="2" class="login_input" />
<input type="image" name="op" id="edit-submit" value="Log in" tabindex="3" src="<?php echo $base_url; ?>/themes/wcc/img/login/login_button.gif" alt="Submit" />
<br />
<a href="<?php echo $base_url; ?>/?q=user/password" title="Retrieve lost password" class="login_form_link" >Lost password?</a>
<input type="hidden" name="form_id" id="edit-user-login" value="user_login" />
</form>
<?php endif; ?>
Thanks to the guys from nossdutytask.com
Vince, contact@webcoastcustom.com
thanks
thanks for the fix club peinguin.Ways to Make Money Online Pizza Takeaway [url=http://yumyummm.co.uk/]Pizza Takeaway[/url]
Return to the current page after user login
if you expand the form action to include a return address, you may be returned to the current page after a successful login.
Exchange this:
<form action="/user" method="post" id="user-login-form">
with this:
<form action="<?php print url('user', drupal_get_destination()); ?>" method="post" id="user-login-form">
horizontal custom drupal login block with active link highlight
Hi guys, you might want to make the Drupal Login Box aligned horizontally.
Like facebook at this url here: Horizontal Custom Drupal Login Block
thanks
thanks for the fix club peinguin.Ways to Make Money Online Claim PPI
I got what you mean , thanks
I got what you mean , thanks for putting up.Woh I am delighted to find this website through google. "The test and use of a man's education is that he finds pleasure in the exercise of his mind." by Carl Barzun.
Top Business Listings
Hi, I just add my personal
I just add my personal touch as I had to figure out how to customize it with my CSS template. Plus, I added the $base_url variable not to be depending on the root location of the website. <a href="http://www.muhabbetim.in" title="Muhabbet, chat">Muhabbet</a> , <a href="http://www.sohbet32.net" title="Sohbet, chat">Sohbet</a>
Hope it helps.
Works
This works fine.
_______________________Neck Pain | Singapore Hotel
This was a solid post. Thank
This was a solid post. Thank you for sharing it. ITIL Certification
RE:
Exchange this: <form
Exchange this:
<form action="/user" method="post" id="user-login-form">
with this:
<form action="<?php print url('user', drupal_get_destination()); ?>" method="post" id="user-login-form">
club penguin
This code looks great,
This code looks great, thanks for the fix club peinguin.Ways to Make Money OnlineÂ
hmm
This is the sample code, you can customize this code to better suit your site configuration :-).
____________________
get degree | graduate diploma
very good comment thanks
very good comment thanks youu
Hi,
I just add my personal touch as I had to figure out how to customize it with my CSS template. Plus, I added the $base_url variable not to be chat depending Mynet on the root location of video sitesi the website.
Hope it helps.
Here is the code:
<?php global $user, $base_url; ?>
<?php if ($user->uid) : ?>
Welcome <?php print ($user->name); ?>
<?php print l("My account",'user/'.$user->uid); ?> |
<?php print l("Log out","logout"); ?>
<?php else : ?>
/user?<?php print drupal_get_destination() ?>" method="post" id="user-login-form">
Username:
Password:
/themes/wcc/img/login/login_button.gif" alt="Submit" />
/?q=user/password" title="Retrieve lost password" class="login_form_link" >Lost password?
<?php endif; ?>
Thanks to the guys from nossdutytask.com
You've some helpful ideas!
You've some helpful ideas! Maybe I ought to consider doing this by my self. i've been looking for this TUT! so far the feedbacks are good, hopefully it will work on me..
I am keen to get best updates
I am keen to get best updates about important things.Please do send me email about these updates.
calorie banana
I am keen to get best updates
I am keen to get best updates about important things.Please do send me email about these updates.wood crusher
Every day I do try to look
Every day I do try to look for the knowledge like that, I saw many sites but yours is very interesting, you got talent in writing articles, blog bookmarked! Waiting for more info! Clubmz Reviews
Thank you for this great
Thank you for this great information, i wait other new infos in the future.Thank you for sharing.
Great Post did not know you
Great Post did not know you can customize the login block. keep up the good work.
good article
I like this site for various causes. Many thanks for your writing and high-quality view
Drupal RewriteRule for Enable or disable clean URLs for Drupal s
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
Order allow,deny
# Don't show directory listings for URLs which map to a directory.
bilngl
I agree with the entire comment above. Thanks for sharing nice information with us.
Good One !
I am Greg Mick to obtain most excellent updates concerning significant belongings. Please do propel me email about these updates.
We need obd2 auto diagnostic tools
The reason why we need the obd2 auto diagnostic tools is the need for curbing "mobile emissions". In tune with the need for global preservation, the EPA has been empowered to place firm emission standards. This has compelled the car manufacturers to bring in better non-polluting cars into the market. In turn, such strict measures for controlling emission levels have also helped to increase the functional life of the vehicle as well.
This subject has interested
This subject has interested me for quite some time. I have just medieval swords started researching it on the Internet and found your post to be informative.
Military Swords
i was looking for this kind
i was looking for this kind of information thanks for sharing this with us.
I would like to share it with
I would like to share it with all my friends and hope they will like it too.
Drupal
Hallo, I'm totally new in Drupal, i use Joomla. Can you someone share with me difference between those too in performance? Thank you!
Glad to visit your blog.
Glad to visit your blog. Thanks for this great post that you share to us…