Hi,
loginlink() shows a link to the login page when not logged in. The link disappears once logged in. Is there a way to display a log out link instead of nothing?
Thanks!
Regards, Ralf.
loginlink() - logOUTlink()
-
- Posts: 2
- Joined: Wed Sep 04, 2013 2:56 pm
Re: loginlink() - logOUTlink()
Fixed it myself, but would be glad to know if there's a better way.
My way:
Added function to cms.php:
Edited template.htm:
My way:
Added function to cms.php:
Code: Select all
function logoutlink() {
return '<a href="?&logout">Logout</a>';
}
Code: Select all
<?php echo loginlink();echo logoutlink();?>
Re: loginlink() - logOUTlink()
Hi Ralf,
If you're using CMSimple_XH >= 1.5.4 use XH_ADM instead of $adm, and remove the global "declaration".
Christoph
IMO it's fine as it is. If you want to hide the logout link when the user is not logged in, you may change the function:wdburgdorf wrote:Fixed it myself, but would be glad to know if there's a better way.
Code: Select all
function logoutlink() {
global $adm;
if ($adm) {
return '<a href="?&logout">Logout</a>';
} else {
return '';
}
}
Christoph
Christoph M. Becker – Plugins for CMSimple_XH