News:

Wondering if this will always be free?  See why free is better.

Main Menu

Date when post was posted?

Started by Opentoe, January 24, 2013, 10:38:14 PM

Previous topic - Next topic

Opentoe

How can I turn on or make visible the date when the post was first made? Example.

Say I'm browsing my forum and see a new thread with many responses. At the right it just says the last responder and the date/time of that response but no where does it say the original post date/response.

When I join a large SMF forum I want to be able to see when a post was first made so I can tell if it is current or not without having to actually go into the post. Maybe a date/time right underneath the post itself? Is that something I can turn on?
Like where it says subject/started by it will list the post topic and started by. Can there be a date added there when that post was made? Is this a feature request?

Thanks


mashby

Isn't it on page 1, first post?!?
Always be a little kinder than necessary.
- James M. Barrie

Arantor

It's not on the message index, which is what the OP is asking about.

No, there isn't an option for it, and it would require multiple changes in the source to actually get it (not least modifying the database query that gets the data)

Shambles

If what is required is along these lines...




... I made a small change to MessageIndex.template.php to add the content of $topic['first_post']['time']

Arantor

Wait,  it actually gets the time for the first post? Why does it do that? Huh, I just figured it would only get what it actually *needed*...

Sleezy

Quote from: Arantor on January 25, 2013, 05:45:15 AM
Wait,  it actually gets the time for the first post? Why does it do that? Huh, I just figured it would only get what it actually *needed*...

Yeah, all 2.03 forum verions should have it... but there is also a mod for earlier versions.
SMFNew Advocate for SMFNew (Dagger)

Arantor

That's the thing, why should they have it? They don't actually display that, so that's a fair amount of function calls and cycles burned on message indexes for something that is never displayed.

Opentoe

Quote from: lowrida018 on January 25, 2013, 01:19:10 PM
Quote from: Arantor on January 25, 2013, 05:45:15 AM
Wait,  it actually gets the time for the first post? Why does it do that? Huh, I just figured it would only get what it actually *needed*...

Yeah, all 2.03 forum verions should have it... but there is also a mod for earlier versions.

Confused. I'm running 2.03 and I should have that?

Arantor

The data processing is already done but you have to make a code change to display it, I'll let Shambles explain as he's done it already.

Shambles

Quote from: Shambles on January 25, 2013, 03:35:50 AM
... I made a small change to MessageIndex.template.php to add the content of $topic['first_post']['time']

Just look for the text that outputs the "started by" string, and add those bits into that.

I made an equivalent change to the recent template too, iirc.

Opentoe

Quote from: Shambles on January 26, 2013, 02:41:15 PM
Quote from: Shambles on January 25, 2013, 03:35:50 AM
... I made a small change to MessageIndex.template.php to add the content of $topic['first_post']['time']

Just look for the text that outputs the "started by" string, and add those bits into that.

I made an equivalent change to the recent template too, iirc.

I see the file and I also see the text to look for, but not comfortable enough to make the changes. I don't know PHP, so for someone that isn't familiar with PHP can make it intimidating. Thanks anyway.

Shambles

Hey OT

You're in the "support" area for your product. You need support, we can give it.

Are you comfortable downloading the named .php file and attaching it to a post in this thread? If so, do it, and sketch out how you'd like the date/time to appear. On my website (the example I gave) I used a tilda (~) to separate the poster info from the date/time but you really can have anything you like.

As I mentioned earlier, there are other places where this info could appear, but for now if you'd like to attach the file I (or someone) can make the change for you. You'd just upload the replacement file to your website.

We're here for ya, buddy :)

TheDragon

Quote from: Shambles on January 28, 2013, 04:06:56 AM
Hey OT

You're in the "support" area for your product. You need support, we can give it.

Are you comfortable downloading the named .php file and attaching it to a post in this thread? If so, do it, and sketch out how you'd like the date/time to appear. On my website (the example I gave) I used a tilda (~) to separate the poster info from the date/time but you really can have anything you like.

As I mentioned earlier, there are other places where this info could appear, but for now if you'd like to attach the file I (or someone) can make the change for you. You'd just upload the replacement file to your website.

We're here for ya, buddy :)

stumbled on your post from a ref: link
per your offer to help
and your pasted pix above is exact what I want

Thanks - if you can edit my attached php (and plz highlight where so I can read and learn !)

THANKS!


Shambles

Messageindex.template.php

Code (Find This) Select
<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], '

Code (Replace With) Select
<p>', $txt['started_by'], ' ', $topic['first_post']['member']['link'], ' ~ ', $topic['first_post']['time'], '


Shambles

Also...

Quote from: Shambles
I made an equivalent change to the recent template too, iirc.

TheDragon


Colin

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Shambles

Quote from: TheDragon on October 22, 2013, 10:16:29 PM
will code in the am

No need to - I attached a replacement to your provided file (unless you're referring to the "recent" template file).

TheDragon

ah - thanks !
did not see your attached file
btw
what do you mean my recent replacement >?

TheDragon

it was  easy to simply replace the line of code you sent
(i have online editor - took 8 secs)

BTW


WORKS GREAT  + love it

thanks !


Shambles

Quote
what do you mean my recent replacement >?
I mean, a similar edit might be needed to file Recent.template.php, as that too can show "started by xxx on yyy" ;)

TheDragon

ahhh . . .
did not even know that file exited  ::)
what does it do ?
and should I also edit it ?
(it works Great at the moment)


TheDragon

i just clicked unread posts since last visit
and time stamps not there

is that what you meant ?

Shambles


SMiFFER

Geeeee! I am forwarded to a thread this old (almost 5 years!) that I had not expected to find help in.

So I edit ../Themes/default/Messageindex.template.php then?

Will try...
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

SMiFFER

Changed it slightly, and it does what I wanted.

Added to my Quick&Dirty-list  ;D

Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

Pipke

if you install this mod -> Avatars on Board and/or MessageIndex

then uncheck al settings about the avatars but leave the last setting, you will have the same result without edit any file ;)

QuoteThis mod will display the avatar of last poster in Board(Child)Index and or the avatar of first and or last poster of topics in MessageIndex.
Extra setting: Display topic starter time in MessageIndex.
"If something is wrong, fix it if you can. But train yourself not to worry: Worry never fixes anything."

Click here to view my mods for SMF

Hey 👋 Did i helped... you like what i do. You can now buy me a coffee! ☕

SMiFFER

Oh thanks a lot!!! That looks even better!!!
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

Advertisement: