Topic: Trouble with parse_message
Are calling parse_message() from one of my own functions but get the error:
Fatal error: Call to a member function on a non-object in /home/www-data/saunalan/forum/include/common.php on line 427
A check shows that that is the censor_words-function that is trying to use the db-object.
I suspect it got something to do with my many includes, and perhaps the db-layer-scope-or-what-its-called.
I do the following:
In my own index.php
<?
chdir('forum');
require('config.php');
require('include/common.php');
require('include/parser.php');
chdir('..');
require('inc/functions.php');
$some_text = "mekkish";
ob_start();
db_include($some_text);
$main_content = ob_get_contents();
ob_end_clean();
echo $main_content;
?>
In inc/functions.php
<?
function db_include($text) {
echo parse_message($text,1);
}
?>
*The code is stripped of non-relevant stuff