miniBB ® 

miniBB

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

Date only from the last Topic and the last Post

 
Author Jaime
Partaker
#1 | Posted: 17 Jan 2015 16:45 
Hello, I am back ... I had taken more time off ;-)

A question in the round:

Here in the forum there are a summary of all topics. Example: How to

How do I get only the date of the last thread?

On the topic of a page have been or more posts. Example: ordering forums

How do I get only the date of the last post?

I want to use this date in the template as eg: Last modified on 2015-xx-xx

Is there already a solution?, or did I just miss it? Thank's for your attention ... and to all an Happy and Good New Year!

Author Paul
Lead Developer 
#2 | Posted: 17 Jan 2015 17:44 
Happy New Year :) though as usually, it has been started not as happy for someone... specially in France.

Jaime:
How do I get only the date of the last thread?
I suppose, you should edit templates/main_topics_cell.html and remove the blocks of HTML having {$topicAuthor} and {$whenPosted}.

Jaime:
How do I get only the date of the last post?
I want to use this date in the template as eg: Last modified on 2015-xx-xx
You will need an extra code in index.php for this.

For example, where is this line:

$topicData=db_simpleSelect(0,$Tt,'topic_title, topic_status, topic_poster, topic_poster_name, forum_id, posts_count, sticky, topic_views, topic_time, topic_last_post_id','topic_id','=',$topic);
You need to extend it with:
$topicData=db_simpleSelect(0,$Tt,'topic_title, topic_status, topic_poster, topic_poster_name, forum_id, posts_count, sticky, topic_views, topic_time, topic_last_post_id, topic_last_post_time','topic_id','=',$topic);
Then you may use {$topicData[10]} in the template or bb_plugins.php.

Author Jaime
Partaker
#3 | Posted: 18 Jan 2015 09:25 
Hi Paul, Thanks for your answer!

I try to express my desire a little more clearly.

1.) When I get to the main page of your board, then there should be (for example) "Last Post from all forums on 2015-xx-xx"

2.) Go to the page of a specific forum (Example How to), then you should stand there "Last post on this forum 2015-xx-xx"

3.) And I go on the side of a single posting in a forum, then there should be "Last entry on this post 2015-xx-xx"

Point 3 is solved by your note with the extra code in index.php !

You all a good Sunday!

Author Paul
Lead Developer 
#4 | Posted: 18 Jan 2015 16:35 
1) , 2)
You may try the following code putting it under bb_plugins.php:

/* Last Post from all forums */
$lastPostForums='';
if($action==''){
if($row=db_simpleSelect(0, $Tp, 'post_time', '', '', '', 'post_id DESC', 1)) $lastPostForums=convert_date($row[0]);
}
/* Last post on the certain forum */
$lastPostThisForum='';
if($action=='vtopic'){
if($row=db_simpleSelect(0, $Tp, 'post_time', 'forum_id', '=', $forum, 'post_id DESC', 1)) $lastPostThisForum=convert_date($row[0]);
}
then, respectively, use {$lastPostForums} for 1) for the front page template; and {$lastPostThisForum} for templates/main_topics.html.

Note: this code is only for the forums, which are all public. Hidden forums would be taken into this update as well. For hidden forums, there would be required more tricky code.

Author Jaime
Partaker
#5 | Posted: 19 Jan 2015 15:23 
Thank you Paul! This works all perfect!

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Date only from the last Topic and the last Post
 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 Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑