as well as having the login/logout links where I have them (in primary links) i also have a link (copying your resulting code) in the body of my page:

This is the home page

here is a <a href="user/login/lightbox2" rel="lightmodal[|width:300px; height:200px;]">user login</a>

which works fine (just the same as your one in the primary links) when I am logged out, but when a user is active, your link changes to "log out" but mine (obviously) doesn't. Is there any way to achieve the same link-change effect you have in the body of my main page?

Thanks

Comments

mattyoung’s picture

Status: Active » Closed (won't fix)

You should post this question to the forum.

ajlowndes’s picture

got it a while ago, just forgot to post my solution. I see this is not really an AccountMenu topic, but here's the solution anyway.

this one will display a lightmodal (Lightbox2) with login if the user is logged out, or a short message "already logged in, logout?" if they are logged in.

<?php
global $user;
if ($user->uid) {
        echo "
<script type=text/javascript>
document.write('<a href=\"' + document.URL + \" #myDiv > *\" + '\" rel=\"lightmodal[|height:40px;width:150px]\">user login</a>')
</script>";
}
else {
  print t('<a href="user/login/lightbox2" rel="lightmodal[|width:300px; height:200px;]">user login</a>');
} ?>
<p>

<div id="myDiv" style="visibility:hidden">
  <div>
<p>already logged in, <a href="/mcc/logout">logout?</a>
  </div>
ajlowndes’s picture

Status: Closed (won't fix) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.