How to add a 'logout' link?
Also, the $mybbuser[username] does not seem to be echoed out.
Quote:Hey, .
Thanks for logging in.
Faltzer Wrote:I thought this was integration, this is more like a Login form. Because after it logs in, it doesn't track the cookies on the site. Only on the forums. Is that even supposed to happen? Is it due to some myBB code change?
You need to have you cookie path set up so that it can be accessed from the location this form is. For example:
If you forum is at /forum/ but this form is at /, your cookie path must be / for the cookie to be accessible by the form.
silentkiller Wrote:How to add a 'logout' link?
// Get the users sid for their uid
$query = $db->simple_select(TABLE_PREFIX.'sessions', 'sid', "uid = '{$mybb->user['uid']}'");
$sid = $db->fetch_field($query, 'sid');
echo("<li><a href=\"YOUR-FORUM-PATH/member.php?action=logout&uid={$mybb->user['uid']}&sid={$sid}\">Logout</a></li>");
Hi,
How about $mybbuser[username] ?
It is not returning anything.
silentkiller Wrote:Hi,
How about $mybbuser[username] ?
It is not returning anything.
The code below does show the username.
I think the first post needs a couple of updates made
echo $mybb->user["username"]
Cheers...
Yeah. Anyway, when I log in it redirtects me to my forums. I don't want it to do that.
How do I stop that, so it just redirects you back to the index page saying "Thanks for logging in"?
Thanks,
BP
Look for :
<input type='hidden' name='url' value='index.php'/>
and change it to something like
<input type='hidden' name='url' value='/index.php'/>
Thanks
Now, I want to add a link on youe username to User CP. But I know how to this
Thanks,
BP
blueparukia Wrote:Thanks
Now, I want to add a link on youe username to User CP. But I know how to this
Thanks,
BP
Here ya go
<a href="FORUM_DIRECTORY/usercp.php"><?php echo $mybb->user["username"]; ?></a>
Cheers Fishntassie...
blueparukia Wrote:But I know how to this
Thanks a lot anyway though. My log in box now consists of User CP, Admin CP (for admins) and Private message links
BP
blueparukia Wrote:blueparukia Wrote:But I know how to this
Thanks a lot anyway though. My log in box now consists of User CP, Admin CP (for admins) and Private message links
BP
Is the code on page one still correct i dont get it t work at all.
- do i have to use the absolute path?
- and my forum is in een sub domain does that matter.
thank you already