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,973
  • Latest: NonStop
Stats
  • Total Posts: 196,236
  • Total Topics: 21,353
  • Online today: 340
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 229
  • Total: 229

Creating a Working logout link

Started by General_Sun, July 14, 2007, 08:58:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fb

Here's what i came up with (works fine in a PHP block)


Quote

global $context, $scripturl;

if ($context['user']['is_logged'])
   echo  '
      <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>';


General_Sun

Super duper! Thank you a great avalanche!

Shane84

Quote from: Number7 on July 15, 2007, 06:34:12 AM
Here's what i came up with (works fine in a PHP block)


Quote

global $context, $scripturl;

if ($context['user']['is_logged'])
   echo  '
      <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>';


That's almost exactly what I was looking for...is there any way to execute that through the sitemap?

Let me explain...I want to eliminate the header all together and use the sitemap as the general navigation, to do this I want to add the logout to the sitemap as well but as we know the session ID makes it difficult.  What I did with this code was insert it into an article and have the sitemap point to it but of course that just makes it a link to a link (redundancy, redundancy).

Perhaps this has been covered already somewhere on here, I'll keep digging but I found this code to be the best help so far.

Zetan

hmmm... the Logout can be defined using SSI functions.

http://yoursite.com/ssi_examples.php

and

http://yoursite.com/ssi_examples.shtml


Your forum comes installed with working examples.

See SMF forums for more info on SSI functions.

Shane84

Won't that again give me a link in the sitemap to a link in an article?

Shane84

What I ended up doing is taking some code Bloc posted in another topic and I created another block directly below the sitemap, it's not perfect but it's better than having a link to a link to log out.

php block with no title but using the theme's frame
echo '<a href="index.php?action=logout;sesc='.$context['session_id'].'"><img src="http://www.pogochat.net/Themes/default/images/TPdivider.gif"/><b> Logout</b></a>';

This website is proudly hosted on Crocweb Cloud Website Hosting.