MyBB Community Forums

Full Version: Integrating MyBB into your website. (Login Form)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Thank you folks. Thats the result.

Quote:Hey, .
Thanks for logging in.

In every time without log in.

HI, folks!
I've made my own module to log into both my site and forum. I copied a code from members.php exactly like they appear under if($mybb->input['action'] == "do_login") . Code works just fine, but I'm still not logged into my forum. Any idea?
Marc O' Connor Wrote:
<?php
chdir('forums'); // path to MyBB
require './global.php';
?>
I have replaced that with:
<?php
chdir('mybb'); // path to MyBB
require './global.php';
?>
But i just get this error:
Quote:Warning: main(./global.php): failed to open stream: No such file or directory in d:\apache\apache\htdocs\mybbinteg\index.php on line 3

Fatal error: main(): Failed opening required './global.php' (include_path='.;c:\php4\pear') in d:\apache\apache\htdocs\mybbinteg\index.php on line 3
I have also tried:
<?php
chdir('mybb'); // path to MyBB
require '/global.php';
?>
And:
<?php
chdir('mybb'); // path to MyBB
require 'global.php';
?>
Are you sure the forum is in the subfolder of that dir? and is in the folder called mybb?
Yeh, that had just hit me like a brick when i was working with the latest news script. Should have been:
<?php
chdir('../mybb'); // path to MyBB
require './global.php';
?>

Is there anyway to make this use a forum on a subdomain, like your main site is at "domain.com" but your forum is at "forum.domain.com"?
No, it all depends on how it is on your ftp server, if you have your forum in an subfolder it would be chdir('subfolder'); .
I really enjoy this and it seems to be working well so far but I was wondering if there is anyway to make a logout kind of thing. I mean I made a link that you can click to logout but after you logout it goes to the forums and not back to the site like it does when you login.
Hi!
What is the problem?
I'm modul:
PHP Code:
<?php
chdir
('./forum/'); // path to MyBB
require './global.php';



if(
$mybb->user['uid'])
{
  
// The user is logged in, say Hi
echo "Szia, $mybbuser[username].<br>
Te m�r bel�pt�l."
;
}

else

{
  
// The user is not logged in, Display the form
echo "<form action='forum/member.php?uid=$mybbuser[uid]' method='post'>
Felhaszn�l�n�v: <input type='text' name='username' size='20' maxlength='30' /><br />
Jelsz�: <input type='password' name='password' size='20' />
<input type='hidden' name='action' value='do_login'>
<input type='hidden' name='url' value='http://mybb.pcn.hu/index.php' />
<input type='submit' class='submit' name='submit' value='Bel�p�s' /></form><br>"
;
}
if(
$mybb->settings['showwol'] != "no" && $mybb->usergroup['canviewonline'] != "no")


?>
Error:
Quote:Fatal error: Call to a member function on a non-object in /USER/mrnagy/pcn.hu/mybb/forum/inc/class_datacache.php on line 33
What's this line for?
if($mybb->settings['showwol'] != "no" && $mybb->usergroup['canviewonline'] != "no")
Remove this line. See if that fixes your problem.
Heh..

I will like to do it like the MyBB Connection site..anyone can give me any tips...?

Where I would take out only special members to login to a certain page.