2009-03-14, 10:32 AM
This is my code
This is my error:
Any ideas? I use FrogCMS as my CMS system.
<?php
$fid = 4;
$limit = 5;
$forumpath = 'forums/';
chdir($forumpath);
define("IN_MYBB", 1);
require('http://sparkonline.net/forums/global.php');
require_once('http://sparkonline.net/forums/inc/class_parser.php');
$parser = new postParser;
chdir('http://sparkonline.net/');
?>
<?php
$query = $db->simple_select(TABLE_PREFIX.'threads', '*', "fid='{$fid}' ORDER BY tid DESC LIMIT {$limit}");
if($db->num_rows($query) > 0)
{
while($row = $db->fetch_array($query))
{
$query2 = $db->simple_select(TABLE_PREFIX.'posts', '*', "pid='{$row['firstpost']}'");
$row2 = $db->fetch_array($query2);
$date = my_date($mybb->settings['dateformat'], $row2['dateline'], "", 1);
$time = my_date($mybb->settings['timeformat'], $row2['dateline'], "", 1);
$options = array(
'allow_html' => 'no',
'filter_badwords' => 'yes',
'allow_mycode' => 'yes',
'allow_smilies' => 'yes',
'nl2br' => 'yes',
'me_username' => 'yes'
);
$message = $parser->parse_message($row2['message'], $options);
echo("<a href=\"{$forumpath}showthread.php?tid={$row['tid']}\">{$row['subject']}</a> -
Posted: {$date} {$time} by <a href=\"{$forumpath}member.php?action=profile&uid={$row2['uid']}\">{$row2['username']}</a><br />");
echo("{$message}<br /><br />");
echo("Replies (<a href=\"{$forumpath}showthread.php?tid={$row['tid']}\">{$row['replies']}</a>)<br /><hr />");
}
}
else
{
echo 'Nothing to display.';
}
?>
This is my error:
Quote:Direct initialization of this file is not allowed.
Please make sure IN_MYBB is defined.
Fatal error: Class 'postParser' not found in /home1/sparkonl/public_html/frog/app/frontend/classes/Page.php(192) : eval()'d code on line 11
Any ideas? I use FrogCMS as my CMS system.