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, 47 guest(s) and 0 member(s) that are online.

You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - Why Won't This Work... Login/Logout link 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
Jolanta
Nuke Cadet
Nuke Cadet


Joined: Nov 04, 2006
Posts: 2


PostPosted: Sun Nov 05, 2006 12:10 am Reply with quoteBack to top

Hi

I am trying to get a "login" link to appear in the header for all visitors which dynamically changes to a "logout" link when a user is logged in.

Can anyone shed any light on why this wont work... the code seems fine to me... I have tried everything to get it working with no success.

HERE IS THE theme header function

Code:
function themeheader() {
    global $banners, $sitename, $login;
    if ($banners) {
include("banners.php");

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

    if (!isset($username)) {
      $username = "$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\">"._LOGOUTHOMEPAGE." </a>";
      }
    else {/* Display if anonymous user */
        $login .= "<a href=\"modules.php?name=Your_Account&amp;op=login\">"._LOGINHOMEPAGE." </a>";
    }
}


and here is the call to display the login or logout link

Code:
echo "<tr align='center'>";
echo "<td width='20%'><a href='index.php'>home</a></td>";
echo "<td width='20%'><a href='modules.php?name=About-Us'>about</a></td>";
echo "<td width='20%'><a href='faq.html'>faqs</a></td>";
echo "<td width='20%'><a href='modules.php?name=Feedback'>contact</a></td>";
echo "<td width='20%'>";
echo "$login";
echo "</td>";
echo "</tr>";


If anyone can point me in the right direction I would really appreciate it

Thanks

Jolanta
Find all posts by JolantaView user's profileSend private message
Evaders99
Site Admin
Site Admin


Joined: Aug 17, 2003
Posts: 12403


PostPosted: Tue Nov 07, 2006 7:00 am Reply with quoteBack to top

I responded on another forum, but for those searching:

$user must be added to the globals

_________________
Helping those that help themselves
Read FIRST or DIE!

"Fighting is terrible, but not as terrible as losing the will to fight."
Star Wars Rebellion Network - Need Help? Evaders Squadron Coding
Find all posts by Evaders99View user's profileSend private messageVisit poster's websiteAIM Address
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.320 Seconds - 290 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::