Hello all, ive looked everywhere to find a solution to my question. Im trying to make the login into a single link. everything jsut leads me to drupal's newer version, but i cannot updgrade because yahoo has not yet disabled the global_registers. Is there any module that allows this to happen or do i have to write code to make the login in to a single link, thanks

Comments

Brandonian’s picture

Do you want it displayed as a single link, or have people go to one url for logging in or out? I can't help you with the second, but here's something for the first.

<?php global $user; // put this at the top of the file ?>
... <!-- code -->
<?php if ($user->uid == 0) {print l('Site login', 'user/login');} else {print l('Logout', 'logout');} ?>
zeroday’s picture

just the first one, i dont understand the second lol, where do i paste that code? and if someone watned to register will it still have that functionality? im using module lightbox 2, so i want the single link login to popout, it does pop out in other parts of the site where it says please sign in to comment but not on the main page where the login block is. thanks for u help

Brandonian’s picture

I don't really have any experience with the lightbox 2 module, but if it's purpose (for this discussion) is to show a popup window for the login, there's probably documentation on how to do it in the module readme file. I've also had luck with similar functionality with the Thickbox module, which has a way to display a login via a lightbox popup.

For an example of how the code I provided earlier shows up on a site, check out this site. It's what creates the login link on the footer. When one is logged into the site, it replaces it with a logout link. I placed my code in the footer area of the page.tpl.php file.