News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Editing posts with [time] tag

Started by Dav999, May 24, 2013, 01:02:21 PM

Previous topic - Next topic

Dav999

Hello, I have found a bug. If you use the time tag in a post, for instance:

[time]1369252530[/time]

It will be converted to a time in the format of the person viewing the thread, as expected:

QuoteMay 22, 2013, 03:55:30 PM
(Using the default format here.)

Quoting the post reveals the [time]1369252530[/time]. However, when you edit the post, the time gets converted inside of the time tags, so instead of [time]1369252530[/time], you see [time]May 22, 2013, 03:55:30 PM[/time] in the post form. That's also what will be visible when you save the post.

I have tested this on SMF 2.0.2 and 2.0.4, and it also happens on this forum.

Arantor

From what I remember that's actually intentional.

However whether it's a *good* idea is another matter entirely. What, exactly, are you trying to do?
Holder of controversial views, all of which my own.


Dav999

Quote from: Arantor on May 24, 2013, 02:09:58 PM
What, exactly, are you trying to do?

Trying to edit a post which contains a time tag. Editing the post should give you the original BBCode of the post, but what should be the time code that was originally entered, becomes the full time string in the post form.

So, for clarity, this is the code of the post:


It shows up like this, which is intended:


Quoting that post gives us this, which is also intended:


However, when I use modify, this shows up:

Arantor

That wasn't really what I asked. Why do you need a timestamp in the first place?
Holder of controversial views, all of which my own.


Dav999

Quote from: Arantor on May 24, 2013, 02:50:21 PM
That wasn't really what I asked. Why do you need a timestamp in the first place?

There might be different uses for it. For example if you want to refer to the time a post was made, because the time may show up differently for everyone because of time zones. Also, I once made four posts in a row somewhere, which I merged later using the time tag to show when each of the posts were made.

Arantor

I don't care about the different uses, I care about the specific use you have. Because there's almost certainly better ways to deal with it.

In the case of the timezone aspect, from what I remember, the time bbc includes the forum+user offsets anyway so that's not a valid argument.

In the case of merging posts, use the merge post mod which has its own bbc for handling time (because it explicitly has to do something different)

In short, this still isn't a bug. It is working exactly as intended by the developers.
Holder of controversial views, all of which my own.


Dav999

Quote from: Arantor on May 24, 2013, 03:08:05 PM
In the case of the timezone aspect, from what I remember, the time bbc includes the forum+user offsets anyway so that's not a valid argument.

That's exactly why that is a valid argument. ??? I meant that if you want the time to show up correctly for everyone, looking at their own time zone, you can use the time tag. But it was only an example.

Quote from: Arantor on May 24, 2013, 03:08:05 PM
In the case of merging posts, use the merge post mod which has its own bbc for handling time (because it explicitly has to do something different)

About the quadruple posts, I was talking about a forum where I'm not an admin. If I were at that point, I don't think I would have installed a mod just to merge some posts when you can edit them, also because I only wanted to merge those posts.

And there may be better methods than the time tag, and the tag isn't broken or something, I just don't get why the original code of a post would change to something the tag isn't compatible with- the output suddenly becomes the input of the tag- and why that would be intended.

Arantor

QuoteI meant that if you want the time to show up correctly for everyone, looking at their own time zone, you can use the time tag. But it was only an example.

Exactly... it's the time the *post was saved* as intended.

QuoteI just don't get why the original code of a post would change to something the tag isn't compatible with- the output suddenly becomes the input of the tag- and why that would be intended.

It has always used the time the post is saved... it's been doing that for a number of years. *Why*, that's another matter... but it is doing what it was designed to do.

I'm primarily trying to establish that this isn't a bug and should be moved out of the bug reports board.
Holder of controversial views, all of which my own.


Advertisement: