miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

include miniBB in my own php file

 
Author chanh
Partaker
#1 | Posted: 9 Jul 2008 15:59 
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!

Author 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?

Author Paul
Lead Developer 
#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.

Author chanh
Partaker
#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

Author chanh
Partaker
#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

Author Paul
Lead Developer 
#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.

Author chanh
Partaker
#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

Author chanh
Partaker
#8 | Posted: 14 Jul 2008 09:25 
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.

Author Paul
Lead Developer 
#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.

Author chanh
Partaker
#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.

Author Paul
Lead Developer 
#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.

Specific miniBB Support Forums / Specific /
 include miniBB in my own php file
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑