Support Forum

Actual date instead for example 3 days ago

CO Condorino47
Condorino47
Member

When looking at the forum front page, I can see under the LAST POST and the USERNAME

Posted 1 days ago or 1month ago etc..

I would really to display instead the actual date and not the XXXXXX ago.

Thanks in advance for suggestions

Antonio

3 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

As Simple:Press is template driven in the same way as WordPress, this will require a small edit to a display template – in this case the spGroupView.php template located in the /templates folder of the SP theme that you are using.

The display function that displays the last post date is (and probably looks like) this:

sp_ForumIndexLastPost(‘tagClass=spInRowPostLink&nicedate=1&date=0&time=0&stackdate=0’, __sp(‘Last Post’), __sp(‘No Topics’));

You can set it the way you want it by changing the ‘nicedate’ value from 1 to 0 (zero meaning off) and the ‘date’ an ‘time’ values from 0 to 1 (1 meaning on).

As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/codex/themes/theme-basics/creating-a-theme/)

CO Condorino47
Condorino47
Member

Yellow Swordfish said
As Simple:Press is template driven in the same way as WordPress, this will require a small edit to a display template – in this case the spGroupView.php template located in the /templates folder of the SP theme that you are using.

The display function that displays the last post date is (and probably looks like) this:

sp_ForumIndexLastPost(‘tagClass=spInRowPostLink&nicedate=1&date=0&time=0&stackdate=0’, __sp(‘Last Post’), __sp(‘No Topics’));

You can set it the way you want it by changing the ‘nicedate’ value from 1 to 0 (zero meaning off) and the ‘date’ an ‘time’ values from 0 to 1 (1 meaning on).

As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/codex/themes/theme-basics/creating-a-theme/)

Thank you

The same situation is when I’m looking and all topics listed under a forum:

On the 4th column there is:
First Post – administrator – 2 weeks ago
and on the 5th column :
Last Post – administrator – 2 weeks ago

On both columns I would like to replace the xxxxxxx.ago with actual date as I did spGroupView.phpfor the forum front page.

 Thanks again

MP Mr Papa
Mr Papa
Member

yes… just have to do similar change to those template functions… in sp_ForumView.php template file…

sp_topicindexfirstpost() – (http://codex.simple-press.com/codex/api/template-functions-and-the-api/display-template-functions/forum-view/sp_topicindexfirstpost/)

sp_topicindexlastpost() – (http://codex.simple-press.com/codex/api/template-functions-and-the-api/display-template-functions/forum-view/sp_topicindexlastpost/)