Ok, below is the updated code. Thanks for your support :-) Paste this code in
bb_plugins.php (preferrably, at the very top after
(!DEFINED...) statement):
/* Displaying latest poster in a forums column */
if(!isset($_GET['action']) and !isset($_POST['action'])){
$forumIds=array();
$forumTitles=array();
$forumPosts=array();
$forumTopics=array();
$topicData=array();
if($row=db_simpleSelect(0,$Tf,'forum_id, forum_name')){
do{
$forumIds[]=$row[0];
$forumTitles[$row[0]]=$row[1];
}
while($row=db_simpleSelect(1));
unset($result);
}//are forums
foreach($forumIds as $k=>$v){
if($row=db_simpleSelect(0,$Tp,'poster_name, post_time, topic_id, poster_id', 'forum_id', '=', $v, 'post_id DESC')){
//here is generated the main HTML code for the output; modify on your wish
if($row[3]!=0) {
$profileLinked="<a href=\"https://www.minibb.com/forums/{$indexphp}action=userinfo&user={$row[3]}\">{$row[0]}</a>";
}
else {
$profileLinked=$row[0];
}
$forumPosts[$v]="Latest post: <b>{$profileLinked}</b>,<br />".convert_date($row[1]).' in ';
$forumTopics[$v]=$row[2];
}
unset($result);
}
unset($forumIds);
/* Topic titles info */
$xtr=getClForums($forumTopics,'where','','topic_id','or','=');
if($row=db_simpleSelect(0,$Tt,'forum_id, topic_title, topic_id', '', '', '')){
do{
$topicData[$row[0]]="<a href=\"".addTopicURLPage(genTopicURL($main_url, $row[0], $forumTitles[$row[0]], $row[2], $row[1]), PAGE1_OFFSET+1)."\">{$row[1]}</a>";
}
while($row=db_simpleSelect(1));
}
unset($xtr);
unset($result);
}
/* --Displaying latest poster in a forums column */
This code will provide what you requested.
In
templates/main_forums_cell.html you may have such code for example:
<td class="caption1 txtC latest noWrap">
{$forumPosts[$forum]}{$topicData[$forum]}
</td>
{$topicData[$forum]} will stand for the topic information (linked title - works for the latest miniBB starting from ver. 2.4).
Then also modify
templates/main_forums.html and rebuild the original code, so you would have 5 tables rows instead of 4 by default:
<tr>
<td style="width:25px;"><img src="https://www.minibb.com/forums/img/p.gif" style="width:25px;height:1px" alt="" /></td>
<td style="width:70%"><img src="https://www.minibb.com/forums/img/p.gif" style="width:1px;height:1px" alt="" /></td>
<td style="width:5%;"><img src="https://www.minibb.com/forums/img/p.gif" style="width:1px;height:1px" alt="" /></td>
<td style="width:5%;"><img src="https://www.minibb.com/forums/img/p.gif" style="width:1px;height:1px" alt="" /></td>
<td style="width:20%;"><img src="https://www.minibb.com/forums/img/p.gif" style="width:1px;height:1px" alt="" /></td>
</tr>
Note that topic title requires additional request, so I didn't remove the above code - it still should work for the simple date and username output.