TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,911
  • Total Topics: 21,307
  • Online today: 884
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 677
  • Total: 677

Self made logout button in a PHP block help.

Started by Stroopy, January 22, 2009, 07:35:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

IchBin

That's because SMF2's code has changed. You'll probably have to do something like this:

"', $scripturl,'?action=logout;', $context['session_var'] ,'=', $context['session_id'],'"

Prophecyrising

That's a no go. If I enter that via the menu manager I get "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''?action=logout;', $context['session_var'] ,'=', $context['session_id'],'"' WHER' at line 1".
I've even tried putting it in manually in mysql.. it goes in but the link does nothing but go to the main page.
The mouse over just comes up "http://mywebsite.com/index.php". No session info at all.

I'm guessing there's no way to do this within the tpmenu structure.

IchBin

So are you trying to do it in the menu manager or a php block like the title of the topic says?

TankGirl

I ended up making a PHP article page with logout confirmation. Like this.
$logoutlink = '<a href="' . $scripturl . '?action=logout;' . $context['session_var'] . '=' . $context['session_id'] . '">[LOGOUT]</a>';
echo "<center><font size=3>Please confirm logout....<br>";
echo $logoutlink;
echo "</font></center>";


Then I made a link in menu manager to link to that article. But I would prefer to find a cleaner way of adding a logout link the menu manager menu. :crazy2:

Lesmond

Quote from: TankGirl on May 28, 2010, 01:35:56 AM
I ended up making a PHP article page with logout confirmation. Like this.
$logoutlink = '<a href="' . $scripturl . '?action=logout;' . $context['session_var'] . '=' . $context['session_id'] . '">[LOGOUT]</a>';
echo "<center><font size=3>Please confirm logout....<br>";
echo $logoutlink;
echo "</font></center>";


Then I made a link in menu manager to link to that article. But I would prefer to find a cleaner way of adding a logout link the menu manager menu. :crazy2:

You could just place that code into a php block, tested and seems to work fine on our test site!

TankGirl

Then I end up writing the whole damn nav block.. a dozen links that always change... the menu manager at least makes this easy and modular.
Oh and i have seperate nav blocks for guest and members.
Especially with articles.. just a drop menu boom link done... lol
I guess i'll just stick to my way until tinyportal decides to add logout option to menus...

IchBin

Well there's no way to pass in any type of variables in the menu manager. Sorry.

This website is proudly hosted on Crocweb Cloud Website Hosting.