MyBB Community Forums

Full Version: Include your custom pages in Mybb
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 8 9 10 11 12 13 14
(2008-09-03, 10:36 AM)Jed K Wrote: [ -> ]So if I have a forum on my root directory and want to create a custom page at /directory1/custompage.php, how should I change the code in the rules.php page? require "./global.php"; doesn't work and I tried a number of other combinations as well with no success.

Please advise. Thanks.
At a guess I would have said... '../../global.php' however failing that you could always reference its absolute path (http://yourforum.com/global.php)... that will work.
Already tried both of those and neither works. Just gives me this error for ../global.php (and ../../global.php):

Warning: main(./inc/init.php) [function.main]: failed to open stream: No such file or directory in /home/myaccount/public_html/mywebsite/global.php on line 13

Fatal error: main() [function.require]: Failed opening required './inc/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/myaccount/public_html/mywebsite/global.php on line 13



And this error if I use the absolute path:

Direct initialization of this file is not allowed.

Please make sure IN_MYBB is defined.
Fatal error: Call to undefined function: add_breadcrumb() in /home/myaccount/public_html/mywebsite/directory1/rules.php on line 6
Would really like to get this working as soon as possible (if possible).

Thanks!
you need turn off GZip Page Compression
It was already turned off in the first place. That has no effect.
Someone please look at this topic and assist me with this. Angel I would really like to get it working as soon as possible!
(2008-09-03, 12:26 PM)Jed K Wrote: [ -> ]Already tried both of those and neither works. Just gives me this error for ../global.php (and ../../global.php):

Warning: main(./inc/init.php) [function.main]: failed to open stream: No such file or directory in /home/myaccount/public_html/mywebsite/global.php on line 13

Fatal error: main() [function.require]: Failed opening required './inc/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/myaccount/public_html/mywebsite/global.php on line 13

Are you sure that both ( '../global.php' and '../../global.php' ) return these errors? each of them should return different error...
Please check again and post result.
Did you have any other problem with your site currently?
Also please try to use absolute path on the server and not relative paths nor url, something like: '/home/user/public_html/sample.php'
../global.php returns the error I listed. ../../global.php is different, you're right; it states that global.php doesn't exist at /directory1/global.php (../../global.php goes one directory too far).



Including the absolute path gives me this error again:

Warning: main(./inc/init.php) [function.main]: failed to open stream: No such file or directory in /home/myaccount/public_html/mywebsite/global.php on line 13

Fatal error: main() [function.require]: Failed opening required './inc/init.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/myaccount/public_html/mywebsite/global.php on line 13



Any other ideas? This must be an obvious fix to someone who's familiar with this kind of situation...

I appreciate your time/help.
Come on, someone has to be able to help me out here. I really need to get this solved.
Awaiting your help.

Thanks.
Don't make me beg. Undecided
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14