Posted on: 05/08/03 07:34pm
By: vbgunz
Can someone be kind enough to help me out with this task? I am trying to put *one* login / logout link in the header file...
It doesn't look right having them both together... [ login : logout ] and leaving either one of them in their doesn't work if I remove the user functions block...
I would like to put in one link that will double as a login *and* logout link... If you're logged out it should say login and if you're logged in it should say logout...
Can someone help me make this happen? Thanks for any feedback on this

How to create a Log-In / Log-Out Double Link
Posted on: 05/09/03 03:42am
By: Dirk
How's your German? ;-)
There's a thread[*1] over at geeklog.info explaining how to do that.
The solution is pretty simple, actually, and relies on the fact that you can use PHP in header.thtml:
<?php
if ($_USER['uid'] > 1) {
print '<a href="' . $_CONF['site_url'] . '/users.php?mode=logout">Logout</a>';
} else {
print '<a href="' . $_CONF['site_url'] . '/users.php?mode=login">Login</a>';
}
?>
bye, Dirk
How to create a Log-In / Log-Out Double Link
Posted on: 05/09/03 04:42am
By: vbgunz
Perfect, thank you so much for the snippet... I actually went to the link you provided using babelfish to translate and I've got to to say... very cool, thank you very much for this

---Victor B. Gonzalez
Re:How to create a Log-In / Log-Out Double Link
Posted on: 01/04/04 06:23pm
By: Anonymous (sh0ck)
I'm trying to create static pages where only members have access.... and I cant do it for one simple reason. Whatever form of PHP i put in, just a simple wont work. This is the error i recieve:
Parse error: parse error in /var/www/staticpages/index.php(78) : eval()'d code on line 1
If somebody finds out how to fix it I'd really appreciate it.
Re:How to create a Log-In / Log-Out Double Link
Posted on: 01/04/04 06:39pm
By: r_f_o_t
[QUOTE BY= sh0ck] I'm trying to create static pages where only members have access.... and I cant do it for one simple reason. Whatever form of PHP i put in, just a simple wont work.[/QUOTE]
Try
here in the FAQ[*2] .
HTH,
Chuck
Re:How to create a Log-In / Log-Out Double Link
Posted on: 01/04/04 07:01pm
By: Anonymous (sh0ck)
thanks. I got it working