You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 62 guest(s) and 1 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Showing Logout in Header [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
anim_chowdhury
Corporal
Corporal


Joined: Nov 17, 2004
Posts: 52


PostPosted: Sat Dec 25, 2004 3:08 am Reply with quoteBack to top

I want to place a "logout" button in the header part of the theme I am using. This "logout" will be shown only when user is logged in.
How can I do that?

Thanks
Find all posts by anim_chowdhuryView user's profileSend private message
teek5449
Sergeant
Sergeant


Joined: Nov 05, 2004
Posts: 148


PostPosted: Sun Dec 26, 2004 8:43 am Reply with quoteBack to top

This should work. Just put the $login wherever you want it to show on your page. Remember to include the $login variable in the global section of your theme.

Code:
    /* User info */
    cookiedecode($user);/* Get cookie info */
    $ip = $_SERVER["REMOTE_ADDR"];
    $uname = $cookie[1];

    if (!isset($uname)) {
      $uname = "$ip";
      $guest = 1;
    }
    if (is_admin($admin)) {/* Display if administrator */
      $login = ""._ADMIN." <a href=\"admin.php?op=logout\"> "._LOGOUT." </a> ";/* Admin:[ Logout ] */
    }   
    if (is_user($user)) {/* Display if registered user */
      $login .= "<a href=\"modules.php?name=Your_Account&amp;op=logout\"> "._LOGOUT." </a>";
      }
    else {/* Display if anonymous user */
        $login .= ""._BWEL.";
    }
Find all posts by teek5449View user's profileSend private message
anim_chowdhury
Corporal
Corporal


Joined: Nov 17, 2004
Posts: 52


PostPosted: Tue Dec 28, 2004 4:08 am Reply with quoteBack to top

Thanks for the reply.
I am using the login block that comes with 7.5 but it doesnt have a "logut" option after login. What I want is just to show "logout", not "login" in the header of theme since login will be shown in Login Block.
Can you tell me in which file I should put the code? (header.htm / theme.php)
Find all posts by anim_chowdhuryView user's profileSend private message
teek5449
Sergeant
Sergeant


Joined: Nov 05, 2004
Posts: 148


PostPosted: Tue Dec 28, 2004 8:56 am Reply with quoteBack to top

The name ($login) is just a variable that you can place anywhere in your theme files that you would like it to show up on your page. BTW I was just too lazy to change the actual name $login to $logoff. I took it from a more complete code that shows a login field if an anonymous user is detected or a welcome message and logoff link if a registered user is detected.
Find all posts by teek5449View user's profileSend private message
winn
Corporal
Corporal


Joined: Mar 30, 2005
Posts: 56


PostPosted: Sun Apr 24, 2005 8:56 am Reply with quoteBack to top

So where exactly does this code go

_________________
Everything is Relative
Find all posts by winnView user's profileSend private message
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by · TOGETHER TEAM srl ITALY http://www.togetherteam.it · DONDELEO E-COMMERCE http://www.DonDeLeo.com
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.583 Seconds - 344 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::