Hello, I'm trying to include punbb in another script....I already have a members area and a template system. I've done this successfully with several other scripts but I'm having a hard time. I'm sure it has something to do with the security, but not sure?
I created a simple php file for testing called my-index.php the contents
<?php
Echo PageCompPageMainCode();
FUNCTION PageCompPageMainCode()
{
GLOBAL $content_w;
GLOBAL $dir;
GLOBAL $site;
$out = '';
$out .= '
<TABLE width="'.($content_w-20).'" cellpadding="4" cellspacing="4">
<TR>
<TD align="center" class="text2">';
ob_start(); # Turn on output buffering
require_once("config.php");
define('PUN', 1);
define('PUN_ROOT', './');
//require_once("include/dblayer/common_db.php"); # External Script includes
// require PUN_ROOT.'include/common.php';
require_once("index.php"); # External Script includes
$out .= ob_get_contents(); # Return the contents of the output buffer
ob_end_clean(); # Clean (erase) the output buffer and turn off output buffering
$out .= '
</TD>
</TR>
</TABLE>';
RETURN $out;
}
?>
The error I keep getting is this
Fatal error: Call to a member function on a non-object in /home/dating/forum/include/functions.php on line 110
I don't know alot about classes but the basic idea is I have a blank page that I want the forum to run in and it will need to be processed in
the function PageCompPageMainCode()
FYI this require is the punbb index.php in the above function
require_once("index.php"); # External Script includes
If I can get it to echo out from PageCompPageMainCode() then PunBB will just run inside my template. Is it possible to do this?
Thanks for any help