miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

Forum latest poster/time in forum titles column

 
 
Page  Page 1 of 2:  1  2  Next »

Author Ant Eksiler
Guest
#1 | Posted: 6 Jun 2005 18:09 
Hi I was just checking .seoguide.org/forums.php

they are using miniBB and changed the way it looked by adding a Last Poster column on main page. How can we do that?
and also they changed the copyright into Powered by SEO-Board :)

Author Team
8-)
#2 | Posted: 6 Jun 2005 19:03 
No, they has not changed that. On seo-board.com, as you may discover, SEO-board is a different forum package. Author of this board, mr. Hristo Hristov, just took a lot of our ideas and developed something he calls his own product. If you look at the code of this board, you will find very many identical moments to miniBB.

We have no claims here - it's open source, and the place where everybody can steal ideas. We are stealing ideas ourselves :-) But amount of ideas Hristo stoled is really huge, and we would be thankful, if he at last mentioned that miniBB was the first point in his software. It is not mentioned at all, so... let it be :-) We are almost sure that miniBB is better than SEO-Board. Just because it is developed and instantly supported within 5 years, SEO-Board - 5 months :-)

As about adding Last Poster to the main forum listings - I could probably write an easy hack for it, if you REALLY need it, and could explain, WHY you really need it. Personally, we don't see the sense having this column, because "Latest Discussions" thing covers it all.

Author Ant Eksiler
Guest
#3 | Posted: 7 Jun 2005 17:52 
Well its just for the look of the page :)

Author Team
8-)
#4 | Posted: 7 Jun 2005 18:24 
So - if for the look, what is wrong with forum listings WITHOUT this field? Is there not enough information on the first page, to get the clue about the forums/users/themes actuality?

Or you just like communism, and doing the same as others do, and wanting the others do the same as you? ;-)

Author Anonymous
Guest
#5 | Posted: 17 Jun 2005 17:23 
Hi,
I am trying to add the last poster for each forum to the index page and I can get it to work for the first one. But it will only show that one forum then.

Is there a special trick to nesting db_simpleSelect commands, or is it even possible?

Thanks,
Mike.

Author Anonymous
Guest
#6 | Posted: 17 Jun 2005 17:53 
Now isn't that typical :)
You post up a question and within minutes, you have the answer staring at you in the face. I sorta did a very dirty hack and added into the db_simpleSelect function. I put in a sus value of 3 and made it return the single value that was asked in the sql query instead of putting the answer in the global variable.
It's mainly the same as the original sus value of 0 but it returns the value too.

Mike.

Author Team
8-)
#7 | Posted: 18 Jun 2005 23:35 
We could probably write an easy hack for it, if you REALLY need it, and could explain, WHY you really need it. Personally, we don't see the sense having this column, because "Latest Discussions" thing covers it all.

Author Anonymous
Guest
#8 | Posted: 20 Jun 2005 18:05 
Yeah I saw that thread, but I have disabled the "Latest Discussions" part of the forum to keep the main page cleaner. I really like the minimal look of the forum, and didnt want to clutter anything up.

Mike.

Author Team
8-)
#9 | Posted: 20 Jun 2005 22:07 
In the file bb_plugins.php, at the very end of file before ?> paste the code below:

/* Displaying latest poster in a forums column */
if($action==''){
$forumIds=array();
$forumPosts=array();

if($row=db_simpleSelect(0,$Tf,'forum_id')){
do{
$forumIds[]=$row[0];
}
while($row=db_simpleSelect(1));
unset($result);

foreach($forumIds as $k=>$v){

if($row=db_simpleSelect(0,$Tp,'poster_name, post_time', 'forum_id', '=', $v, 'post_id DESC')){
//here is generated the main HTML code for the output; modify on your wish
$forumPosts[$v]="Latest post: <b>{$row[0]}</b>,<br>".convert_date($row[1]);
}

unset($result);
}
unset($forumIds);
}//are forums
}
//Your template main_forums_cell.html variable is {$forumPosts[$forum]}
/* --Displaying latest poster in a forums column */
Then paste {$forumPosts[$forum]} in the file under templates/main_forums_cell.html, it will contain such output information.

Author Anonymous
Guest
#10 | Posted: 23 May 2006 16:34 
One problem that I'm having is the format of the date and time. It seems to be squished together. Any ideas?

Author Paul
Lead Developer 
#11 | Posted: 25 May 2006 17:10 
I guess you have modified the code mentioned, so can not determine the reason exactly. However, this string:

$forumPosts[$v]="Latest post: <b>{$row[0]}</b>,<br>".convert_date($row[1]);

is the place where your date is sent on output. Be sure it has given syntax.

Author Anonymous
Guest
#12 | Posted: 26 May 2006 21:17 
$forumPosts[$v]="{$row[0]}<br>$row[1]";

Worked for me.

Author lozmatic
Partaker
#13 | Posted: 25 May 2010 23:07 
Hi,

Thanks for this.... just what I need :)

A couple of extra things would make it perfect:

1. To include the title (linked) of the discussion.
2. Make the username linked to the profile.

Cheers,

Lawrence

Author Paul
Lead Developer 
#14 | Posted: 1 Jun 2010 05:25 
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&amp;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.

Author lozmatic
Partaker
#15 | Posted: 1 Jun 2010 07:48 
Thanks Paul :)

This works if I put it in bb_specials.php and not bb_plugins.php

Also, it would be great to format the date like this: DD-MM-YYY @ HH:MM:SS

Is that possible?

Page  Page 1 of 2:  1  2  Next » 
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Forum latest poster/time in forum titles column
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Check out the Private Messaging add-on: allow your miniBB-forums members to communicate with each other.


  ⇑