MyBB Community Forums

Full Version: Website Integration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
Andy, you cannot set cookies across unrelated domains. MyBB uses cookies to keep track of your session id, login id (both as regular user and admin).

If bother domains are hosted on the same computer, you could include() MyBB's global.php and share usernames and passwords.
I got a problem when I try to intergrate the forum to my site.
Here is what I have done before any HTML output:

$cur = getcwd();
chdir("newforums");
include "./global.php";
chdir($cur);

and here is what I get:

Fatal error: Cannot redeclare class timer in c:\programmer\easyphp1-8\www\gms2mybb\newforums\inc\class_timers.php on line 12

Anybody know what's wrong?
You are using another script on your homepage, both are using functions, unfortunately the both scripts are using the same name for a function, I ran into that problem before but couldn't find a solution (besides not using the other srcipt).
yo would have to go through the whole of the other script chaning the function name
Yeah but it shouldn't be a problem when I load the mybb global.php before everything else should it?

[edit]
Sorry I just found out that it was my faul... I included the file twice Toungue
Alright, I've been trying to include a login box on my main site for the last week and haven't had any luck getting it to work. The code I'm using is below. The problem is it doesn't matter if I'm logged in or not... it constantly displays the "Thanks, you are logged in!" message. Does anyone know what I'm doing wrong?

I'm using...
<?php
chdir("/public_html/forums");
require "http://forums.zerovision.net/global.php";

$info = explode("_", $_COOKIE['mybbuser']);
$result = mysql_query("SELECT loginkey FROM mybb_users WHERE uid=".intval($info[0]));
$user = @mysql_fetch_array($result);
if($user[1] == $user['loginkey'])
{
    echo ("<center>Thanks, you are logged in!</center>");
}

else {
?>
<form action="http://forums.zerovision.net/member.php" method="post">
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://www.zerovision.net/project/index.php" />
<input type="submit" class="submit" name="submit" value="Login" /></form>
<?php
}
?>
delete the cookies from your system?
So that could should work fine? My site is in a sub directory of my root called "news" and my forums is in a sub directory of root called "forums".
yes, I believe that code should work fine
Well for some reason its not working for me.... any ideas? does global establish a connection to the forum database?
Pages: 1 2 3 4 5 6 7