2007-08-21, 06:45 PM
2007-08-21, 06:54 PM
DCR Wrote:Hmm Thanks, but it did not work..It should have done. Here's what each option in that array does:
// * @param array Array of yes/no options - allow_html,filter_badwords,allow_mycode,allow_smilies,nl2br,me_username.
What does it output actually output?
2007-08-21, 07:01 PM
It outputs the HTML codes.
By the way, I;m using the multipage one if it has anything to do, but I doubt it since it has the same array.
By the way, I;m using the multipage one if it has anything to do, but I doubt it since it has the same array.
2007-08-21, 07:04 PM
Oops, my bad:
Change it to:
Change it to:
$options = array(
'allow_html' => 'yes',
'filter_badwords' => 'yes',
'allow_mycode' => 'yes',
'allow_smilies' => 'yes',
'nl2br' => 'yes',
'me_username' => 'yes'
);
$message = $parser->parse_message($row2['message'], $options);
2007-08-21, 07:24 PM
Ah perfect. Thank
2007-08-26, 08:53 AM
i am getting errors
you can see it at http://devtech.org
Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home43a/sub006/sc31956-OAMT/www/index.php:11) in /mounted-storage/home43a/sub006/sc31956-OAMT/www/forum/inc/functions.php on line 1133
Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home43a/sub006/sc31956-OAMT/www/index.php:11) in /mounted-storage/home43a/sub006/sc31956-OAMT/www/forum/inc/functions.php on line 1133
Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home43a/sub006/sc31956-OAMT/www/index.php:11) in /mounted-storage/home43a/sub006/sc31956-OAMT/www/forum/inc/functions.php on line 1133
you can see it at http://devtech.org
2007-08-26, 09:01 AM
This part should be before anything which outputs to the screen, is it?
It doesn't matter where the rest of the code goes so long as that code is put before any output.
$fid = 2;
$limit = 5;
$forumpath = 'forum/';
chdir($forumpath);
define("IN_MYBB", 1);
require('./global.php');
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
chdir('../');
It doesn't matter where the rest of the code goes so long as that code is put before any output.
2007-08-26, 09:08 AM
okay this is what i done
news.php
<?php include("news.php"); ?>
and i am getting that error
news.php
<?php
$fid = 3;
$limit = 5;
$forumpath = 'forum/';
chdir($forumpath);
define("IN_MYBB", 1);
require('./global.php');
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
chdir('../');
$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', '*', "tid='{$row['tid']}' LIMIT 1");
$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.';
}
?>
then i put this on my index.php<?php include("news.php"); ?>
and i am getting that error
2007-08-26, 09:14 AM
Probably because the include is placed after the headers have ended. (Content has started).
If you want to do that; make two files. Make a file called "newsheader.php" and include it after the <?php bit at the very top of the page you want to include it on. Fill the file with the following:
Now edit your current "news.php" so that it has the remaining code and include it from where your currently are:
If you want to do that; make two files. Make a file called "newsheader.php" and include it after the <?php bit at the very top of the page you want to include it on. Fill the file with the following:
<?php
$fid = 2;
$limit = 5;
$forumpath = 'forum/';
chdir($forumpath);
define("IN_MYBB", 1);
require('./global.php');
require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser;
chdir('../');
?>
If your page has HTML before it's PHP (i.e. Content before the <?php tag) then place this at the very top of the file like this:<?php include('newsheader.php'); ?>
Now edit your current "news.php" so that it has the remaining code and include it from where your currently are:
<?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', '*', "tid='{$row['tid']}' LIMIT 1");
$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.';
}
?>
2007-08-26, 09:19 AM
nop still did not work http://devtech.org/ see it just put the error at the top of the page now.