miniBB Support Forums
|
Forums
|
Register
|
Reply
|
Search
|
Statistics
|
Manual
|
miniBB Support Forums
/
Specific
/
include miniBB in my own php file
chanh
Registered
#1
|
Posted: 9 Jul 2008 15:59
|
Edited by: chanh
I tried to integrate miniBB with my own php file using what was suggested in the "manual" and here is the code that I use but getting lot of errors. Any suggestion would be appreciated.
<?php
minibb();
function minibb() {
$retdir = getcwd();
echo $retdir;
chdir ('../minibb');
$cdir = getcwd();
echo $cdir;
ob_start();
include ('./index.php');
$flushed=ob_get_contents();
ob_end_clean();
chdir($retdir);
echo $flushed;
}
?>
Errors:
Notice: Undefined index: action in F:\devroot\htdocs\minibb\index.php on line 72
Notice: Undefined index: cookiename in F:\devroot\htdocs\minibb\bb_cookie.php on line 91
Notice: Undefined index: Tb in F:\devroot\htdocs\minibb\setup_mysql.php on line 101
Notice: Undefined index: pathToFiles in F:\devroot\htdocs\minibb\bb_functions.php on line 14
Notice: Undefined index: pathToFiles in F:\devroot\htdocs\minibb\bb_functions.php on line 14
Notice: Undefined index: pathToFiles in F:\devroot\htdocs\minibb\bb_functions.php on line 14
Notice: Undefined index: pathToFiles in F:\devroot\htdocs\minibb\bb_functions.php on line 14
Notice: Undefined index: indexphp in F:\devroot\htdocs\minibb\bb_functions.php on line 66
Notice: Undefined index: indexphp in F:\devroot\htdocs\minibb\bb_functions.php on line 69
Notice: Undefined index: startIndex in F:\devroot\htdocs\minibb\bb_functions.php on line 72
Notice: Undefined index: action in F:\devroot\htdocs\minibb\bb_functions.php on line 74
Notice: Undefined index: action in F:\devroot\htdocs\minibb\bb_functions.php on line 79
Notice: Undefined index: main_url in F:\devroot\htdocs\minibb\bb_functions.php on line 79
Notice: Undefined index: indexphp in F:\devroot\htdocs\minibb\bb_functions.php on line 79
Notice: Undefined offset: 3 in F:\devroot\htdocs\minibb\bb_functions.php on line 79
Notice: Undefined index: l_sepr in F:\devroot\htdocs\minibb\bb_functions.php on line 79
Notice: Undefined index: viewTopicsIfOnlyOneForum in F:\devroot\htdocs\minibb\bb_functions.php on line 81
Notice: Undefined index: action in F:\devroot\htdocs\minibb\bb_functions.php on line 94
Notice: Undefined index: main_url in F:\devroot\htdocs\minibb\bb_functions.php on line 94
...
There are so much more!
I tried with iframe and it works ok but I rather integrate not using iframe.
Thanks in advance!
imhsps
Guest
#2
|
Posted: 9 Jul 2008 17:17
Hello... I'm trying to do it too at my website. I was created an plugin for work inside the minibb, one plugin for each one page... but I want do it and lock for members only these pages, but I can't... Anyone know how to do it?
Paul
CEO
#3
|
Posted: 10 Jul 2008 03:23
chanh
You can't use a function for that. The code must be the same as it's provided in manual. Inside a function, none of the global variables won't work (or they all must be declared in advance).
imhsps
I have no ideas what you mean.
chanh
Registered
#4
|
Posted: 10 Jul 2008 09:49
If I include into a php file then it would work as you say but my site does not run php directly, it load through a theme then run any php code and that is how I would like to integrate miniBB but it does not seem to work.
Would you have a handy list of global variables that I need to declare in advance before I call miniBB?
Thanks
chanh
Registered
#5
|
Posted: 10 Jul 2008 10:04
After I add all these global variables and it runs without errors but I only get a miniBB forum header but the body is blank with some |||| in it.
global $action, $cookiename, $Tb, $pathToFiles, $indexphp, $startIndex, $main_url, $l_sepr, $viewTopicsIfOnlyOneForum, $user_id, $enableNewRegistrations, $sitename, $l_months, $dateFormat, $l_menu;
Any suggestion?
Thanks
Paul
CEO
#6
|
Posted: 10 Jul 2008 13:21
I have no ideas what are you trying to achieve, but whatever I can tell: it
won't work
when called from a function.
chanh
Registered
#7
|
Posted: 10 Jul 2008 22:29
ok, then it sound like miniBB is not flexible enough for my need to integrate into my cms.
Thanks
chanh
Registered
#8
|
Posted: 14 Jul 2008 09:25
|
Edited by: chanh
I just realize my previous post does not sound very productive and sorry if I offend any one.
I do have a suggestion though if miniBB can have a list of know global variables or just one super global variable that can be use to integrate with others app would go a long way to make miniBB truely "mini" and can be very useful for anyone that wish to integrate into their site and cms of choice.
I see an impressively list of add-on here and would love to be able to integrate into my cms offering.
Thanks for your time.
Paul
CEO
#9
|
Posted: 14 Jul 2008 11:13
chanh
I don't understand why you need a function to call it. The function always complicates the things. Example from manual clearly shows you can just include a PHP file of miniBB and remember it's content in a variable. But this just need to be INCLUDED NOT FROM A FUNCTION. Later, you may use this variable in your function. What's so difficult? You see a complicated way but don't see a simple one.
chanh
Registered
#10
|
Posted: 16 Jul 2008 23:00
Per your suggestion this is the code that I end up doing but still having the same problem
<?php
$retdir = getcwd();
//echo "<br />".$retdir;
chdir ('../minibb');
$cdir = getcwd();
//echo "<br /".$cdir;
ob_start();
global $action, $cookiename, $Tb, $pathToFiles, $indexphp, $startIndex, $main_url, $l_sepr, $viewTopicsIfOnlyOneForum, $user_id, $enableNewRegistrations, $sitename, $l_months, $dateFormat, $l_menu;
include ('./index.php');
$flushed=ob_get_contents();
ob_end_clean();
chdir($retdir);
echo $flushed;
?>
This code is just being include into my cms not via a function.
Thanks for your time.
Paul
CEO
#11
|
Posted: 17 Jul 2008 03:17
chanh
I have no ideas what exactly is not working and for what reason. Your question is custom and it's a subject of our paid investigation only. But I'm sure there is a way to let it work, your case is very simple. I've integrated miniBB into the systems which were more difficult.
miniBB Support Forums
/
Specific
/ include miniBB in my own php file
↑
Top
Your Reply
Short link for this topic:
?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.
Before posting, make sure your message is compliant with our
forum posting rules
. If not, it may be locked or deleted with no explanation.
News & Announcements
FAQ
How To
Bugs
The Other
Official Addons and Solutions
Custom Tutorials and Modifications
Master Class
Specific
Re-cycled
Suggestions
Testimonials
qwerty
Features
Requirements
Demo
Download
Showcase
Gallery of Arts
Compiler
Premium Extensions
Premium Support
License
Contacts
Worried about forum enemies?
Pre-approve postings and members with the
Premoderation add-on
!