can i get the sessionid within an plugin?
#1
Hi,

I have a little Problem with an Plugin on my Board.
I would like to use this -> Welcome User Panel
But the logout link does not work.
The link looks like this:
<a href=\"{$mybb->settings['bburl']}/member.php?action=logout&uid={$mybb->user['uid']}\">{$lang->welcome_logout}</a>
and I've changed it to this:
<a href=\"{$mybb->settings['bburl']}/member.php?action=logout&uid={$mybb->user['uid']}&sid={$session->sid}\">{$lang->welcome_logout}</a>
But the Session ID is still empty...
Whats the Problem there? Isnt it possible to get the sessionid within a plugin?

Thanks for help
lordy...
Reply
#2
$query = $db->simple_select(TABLE_PREFIX."sessions", "sid", "uid = '{$mybb->user['uid']}'");
$sid = $db->fetch_field($query, "sid");
[Image: sig.php]
The little boat gently drifted across the pond exactly the way a bowling ball wouldn't.
Reply
#3
Hi MrDoom,

many thanks for your help, it works Big Grin
I think i have to learn more about myBB, its really great!

have a nice day,
lordy
Reply
#4
If you're in a plugin function you might need to global it first:

global $session;
Dennis Tsang
Former MyBB Team Member
Web: http://dennistt.net
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)