2008-08-06, 07:27 PM
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
2008-08-07, 05:06 PM
(2008-08-06, 05:01 PM)DraconisCombine Wrote: [ -> ]Works perfectly for me in 1.4 as is actually. What error are you getting?
Not really getting an error, per say. But it isn't working correctly. It won't "remember" that I'm logged in on the Main Page, but when I go to the forums I am logged in okay.
Using this code before anything:
<?php
define("IN_MYBB",1);
chdir('forum'); // path to MyBB
require './global.php';
?>
and this where i want the box to appear:
<?php
if($mybb->user['uid'] > 0) { // The user is logged in, say Hi
echo "Hey, ". $mybb->user['username'] .".<br>Thanks for logging in.<br><br>";
} else {
// The user is not logged in, Display the form
echo "<form action='http://lorddonk.890m.com/forums/member.php' method='post'>
<input type=\"hidden\" name=\"my_post_key\" value=\"$mybb->post_code\" />
Username: <input type='text' name='username' size='25' maxlength='30' /><br />
Password: <input type='password' name='password' size='25' />
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='http://lorddonk.890m.com/index.php' />
<input type='submit' class='submit' name='submit' value='Login' /></form><br>";
}
?>
Basically, the problem is it keeps prompting you to log-in with the text boxes on the main page, even though you already are...
2008-08-07, 05:11 PM
Are your cookie domain and path set properly? [wiki]Cookies#Cookie_Settings[/wiki]
2008-08-07, 05:19 PM
(2008-08-07, 05:11 PM)Michael83 Wrote: [ -> ]Are your cookie domain and path set properly? [wiki]Cookies#Cookie_Settings[/wiki]
I have set them according to this http://www.dennistt.net/mybb/cookiesettings.php
But should I maybe change the cookie path so its not just in MyBB? Trying that now...
EDIT: Didn't work...
2008-08-09, 03:59 AM
I have been attempting to integrate my site pages with MyBB 1.4, the way it worked on 1.2, but with no luck.
It seems that
Can someone please shed some light on what can now be used to get MyBB user information on pages outside of MyBB?
It seems that
$mybb->user[]
no longer works outside of global.php and a select other few of MyBB's pages, all $mybb->user array bits return 0 or "" (null string).Can someone please shed some light on what can now be used to get MyBB user information on pages outside of MyBB?
2008-09-28, 06:37 PM
Did anyone figure this out!? Can anyone post the code that is supposed to work in 1.4?
2008-10-01, 06:27 PM
i got it worked on my site it works pretty well even with myBB 1.4
2008-10-11, 10:40 PM
I have an existing website with several users. Does anyone know how to integrate MyBB with your existing login. What I want to do is have my users login to my website and when they click the forum link be automatically logged in to MyBB. I've tried passing the params through the session and redirecting but its not working.
Any help....please.
Any help....please.
2008-10-12, 08:58 AM
Thanks I really needed that
2008-10-23, 06:42 AM
hello I have one little problem with this code
when I logout from my website it doesn't log me out from my forum ... it stay logged in.
i use this code before anything:
and this where the login box appear:
any idea?
ps
sorry for my english.
when I logout from my website it doesn't log me out from my forum ... it stay logged in.
i use this code before anything:
<?php
define("IN_MYBB",1);
chdir('forum'); // path to MyBB
require './global.php';
?>
and this where the login box appear:
<?php
if($mybb->user['uid'] > 0) { // The user is logged in, say Hi
echo "Hey, ". $mybb->user['username'] .".<br>Thanks for logging in.<br><br>";
} else {
// The user is not logged in, Display the form
echo "<form action='forum/member.php' method='post'>
<input type=\"hidden\" name=\"my_post_key\" value=\"$mybb->post_code\" />
Username: <input type='text' name='username' size='25' maxlength='30' /><br />
Password: <input type='password' name='password' size='25' />
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='index.php' />
<input type='submit' class='submit' name='submit' value='Login' /></form><br>";
}
?>
any idea?
ps
sorry for my english.