2007-08-26, 09:24 AM
That means that something is still executing before the header stuff. Can you show me the code for your index page? PM me it if you don't want to post it here.
$query3 = $db->simple_select(TABLE_PREFIX."users", "displaygroup", "uid = '{$row2['uid']}'");
$gid = $db->fetch_field($query, "displaygroup");
$query4 = $db->simple_select(TABLE_PREFIX."usergroups", "namestyle", "gid = '{$gid}'");
$username = $db->fetch_field($query, "namestyle");
$username = str_replace("{username}", "$row2['username']", $username);
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 />");
With: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']}\">{$username}</a><br />");
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /mounted-storage/home43a/sub006/sc31956-OAMT/www/news.php on line 15
$username = str_replace("{username}", "$row2['username']", $username);
Change it to:$username = str_replace('{username}', "$row2['username']", $username);
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /mounted-storage/home43a/sub006/sc31956-OAMT/www/news.php on line 15
<?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);
$query3 = $db->simple_select(TABLE_PREFIX."users", "displaygroup", "uid = '{$row2['uid']}'");
$gid = $db->fetch_field($query, "displaygroup");
$query4 = $db->simple_select(TABLE_PREFIX."usergroups", "namestyle", "gid = '{$gid}'");
$username = $db->fetch_field($query, "namestyle");
$username = str_replace('{username}', "$row2['username']", $username);
$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']}\">{$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.';
}
?>
<?php
$fid = 2;
$limit = 5;
$forumpath = 'board/';
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("<h3><strong><a href=\"{$forumpath}showthread.php?tid={$row['tid']}\">{$row['subject']}</a></strong> <small>-
Posted: {$date} {$time} by <a href=\"{$forumpath}member.php?action=profile&uid={$row2['uid']}\">{$row2['username']}</a></small></h3><br />");
echo("<p>{$message}</p><br />");
echo("<span style='color: #999999;'>Replies (<strong><a href=\"{$forumpath}showthread.php?tid={$row['tid']}\">{$row['replies']}</a></strong>) -
Views <strong>{$row['views']}</strong></span>
<br /><div style='border-bottom: 1px dashed #505050; margin: 2px 0 16px;'></div>");
}
}
else
{
echo 'Nothing to display.';
}
?>
$username = str_replace('{username}', "$row2['username']", $username);
To$username = str_replace('{username}', $row2['username'], $username);