MyBB Community Forums

Full Version: [NOT Resolved] Includes broken
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello.

I wanted to add a login box to my forum on my website, but when I put the following code, my includes doesn't work anymore.
	<?php
		define("IN_MYBB", 1);
		require "../forum/global.php";
	?>

The page index.php includes the page global.php which includes the pages header_en.php (which contains the code), menu_en.php and footer_en.php. The two last pages are not displayed anymore with the code.

Can someone help me? Thanks.
<base href="{$mybb->settings['bburl']}/" /> ??
Fixed my problem when i tried to do stuff from another directory...
Although i fear it's only related to linking.
( Perhaps if you change it using another function instead of href it might help :/ )
Do you think that replacing
        require "../forum/global.php";
with
        require "{$mybb->settings['bburl']}/global.php";
will fix the problem?

Or using
$mybbdir = "{$mybb->settings['bburl']}";
then
        require $mybbdir . "/global.php";
?

But how can PHP know the content of {$mybb->settings['bburl']} as I'm in the website, and not in MyBB ?

It doesn't work : as I thought : {$mybb->settings['bburl']} = no such file or directory.

Another idea? It's pretty urgent...
Yes, that is what i meant !

Well for example: www.mysite.com/forum/ is mybb
your site is www.mysite.com/

You include the page under www.mysite.com/ so now it thinks that the included files are in www.mysite.com/menu_en.php and www.mysite.com/header_en.php whilst they are under /forum/

I'd suggest trying $mybbdir first, that was the one i actually tried to mention but it slipped my mind.
Hope it works out.
In fact, it doesn't try to include the files, it's as if the includes were "deleted" by the code.
But the files I want to include ARE in http://www.mysite.com/, not in /forum/ ...
Ohh sorry, than i mistook the situation.
I'm no php expert, but someone else must be able to help you by a quick function.
Up : the following line :
require "../forum/global.php";
breaks my includes : the files called by the include functions after this line are not displayed.

Someone has an idea ?
Is global.php in www.mysite.com/forum/ and is the file your trying to include it from in mysite.com?
If so, change:
require "../forum/global.php";
To:
require "./forum/global.php";
global.php is in http://www.mysite.com/forum/ and the files I'm trying to include are in http://www.mysite.com/web/ .
Try to link the file by using the full path, eg. /home/www/mysite.com/htdocs/forum/global.php but obviously using your hosts full path.
Pages: 1 2