3
This should do it. This is near line 280
i commented some stuff out and added some code. Begin.End
$topic['title'] = $title;
$topic['replies'] = $arr['topic_replies'];
$topic['views'] = $arr['topic_views'];
$topic['time'] = newbb_formatTimestamp($arr['topic_time']);
/* if (!empty($author_name[$arr['topic_poster']])) {
$topic_poster = $author_name[$arr['topic_poster']];
} else {
$topic_poster = $myts->htmlSpecialChars( ($arr['poster_name'])?$arr['poster_name']:$GLOBALS["xoopsConfig"]["anonymous"] );
}
$topic['topic_poster'] = $topic_poster;*/
// Begin
$query = 'SELECT';
$query .= ' p.uid, p.topic_id, p.post_time, t.topic_id'.
' FROM ' . $db->prefix('bb_posts') . ' AS p '.
' LEFT JOIN ' . $db->prefix('bb_topics') . ' AS t ON t.topic_id=p.topic_id';
$query .= ' WHERE t.topic_id='.$topic['id'].
$forum_criteria .
$approve_criteria .
$extra_criteria .
' ORDER BY p.post_time DESC';
$result = $db->query($query, $options[1], 0);
if (!$result) {
newbb_message("newbb block query error: ".$query);
return false;
}
$row = $db->fetchArray($result);//we only want 1 anyways.
$topic['topic_poster'] = newbb_getUnameFromId($row['uid'], $newbbConfig['show_realname'], true);
unset($row);
//END
$topic['topic_page_jump'] = $topic_page_jump;
$block['topics'][] = $topic;
unset($topic);
}
$block['indexNav'] = intval($options[4]);
return $block;
}