Skip to main content
Topic: [RC2] yesterday and today are missing in user profile (Read 2708 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[RC2] yesterday and today are missing in user profile

If you choose to use "yesterday" and "today" as time format and click on the latest actions in a user profile, you can see, that for actions made yesterday and today only the time is shown, not the day. Shouldn't this be for example "yesterday at 9:05 am"?

Recent Activity without "Today & Yesterday"

Reply #1

Hello!

I don't know, if this could be a bug, but I want to tell you:

 If you are using "Today and Yesterday" this is displayed in Infocenter, but not in the profiles. If I look at "Recent Activity" the complete dates of older posts are shown, but if there are posts from today and yesterday, is just the time displayed.

Re: [RC2] yesterday and today are missing in user profile

Reply #2

Upps...sorry Jorin. You were much faster then me. :-[

Doppelpost...so ein Mist...wie peinlich (wie sagt man sowas auf Englisch?)


Re: [RC2] yesterday and today are missing in user profile

Reply #4

LOL

Better 2 than none! ;D
I'll merge the topics. ;)
Bugs creator.
Features destroyer.
Template killer.

Re: [RC2] yesterday and today are missing in user profile

Reply #5

hmm... it looks like this section uses the strings from Who.<language>.php
Bugs creator.
Features destroyer.
Template killer.

Re: [RC2] yesterday and today are missing in user profile

Reply #6

Found the issue: determineActions loads the Who language, that in the new form overrides $txt['today'] and $txt['yesterday'].
For the moment, the safest way to deal with it I think it's to re-load index just after determineActions in ProfileInfo.controller.php like this:
Code: [Select]
			$action = determineActions($user_profile[$memID]['url']);
loadLanguage('index');

@Spuds any other idea?
Bugs creator.
Features destroyer.
Template killer.

Re: [RC2] yesterday and today are missing in user profile

Reply #7

Not really ... I have not looked at the text, I assume there is a good reason for the same txt string with different values.  IMO nothing should overwrite index txt to begin with but instead add their own if what index defines is not right for the application.  But for now doing what you suggest is the best way at this time.

Re: [RC2] yesterday and today are missing in user profile

Reply #8

Yes, there is a kind of "good" reason: once upon a time (i.e. about two weeks ago), the today string was:
Code: [Select]
$txt['today'] = 'Today ';
and it was concatenated in standardTime with the date:
Code: [Select]
$txt['today'] . $time;
Then in who, the "today" text was removed with a trick like this:
Code: [Select]
$time = strtr(standardTime($time), $txt['today'], '');
the same for yesterday.

About a couple of weeks ago I stumbled upon that code, and thought that this was a bit hackish and that the today was not really good for localization, so I changed $txt['today'] to:
Code: [Select]
$txt['today'] = 'Today $1%s';
but then, the strtr was now impossible, so I thought overwrite the index was the only way to obtain the expected result without adding another string to strtr it out from the today in who that was a bit "odd"...

Hope the description makes sense. lol
Bugs creator.
Features destroyer.
Template killer.

Re: [RC2] yesterday and today are missing in user profile

Reply #9

So no chance to fix this?

Re: [RC2] yesterday and today are missing in user profile

Reply #10

I wrote the fix in the reply #6... why do you read it is not going to be fixed? ???
Bugs creator.
Features destroyer.
Template killer.

Re: [RC2] yesterday and today are missing in user profile

Reply #11

Oops, I lost track. :-[  So it will be changed as described in #6. Good!