ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: Jorin on August 29, 2014, 03:30:58 am

Title: [RC2] yesterday and today are missing in user profile
Post by: Jorin on August 29, 2014, 03:30:58 am
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"?
Title: Recent Activity without "Today & Yesterday"
Post by: Ruth on August 29, 2014, 03:41:45 am
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.
Title: Re: [RC2] yesterday and today are missing in user profile
Post by: Ruth on August 29, 2014, 03:44:37 am
Upps...sorry Jorin. You were much faster then me. :-[

Doppelpost...so ein Mist...wie peinlich (wie sagt man sowas auf Englisch?)
Title: Re: Recent Activity without "Today & Yesterday"
Post by: Jorin on August 29, 2014, 03:45:59 am
See: http://www.elkarte.net/community/index.php?topic=1910.0 (http://www.elkarte.net/community/index.php?topic=1910.0)
Title: Re: [RC2] yesterday and today are missing in user profile
Post by: emanuele on August 29, 2014, 05:06:42 am
LOL

Better 2 than none! ;D
I'll merge the topics. ;)
Title: Re: [RC2] yesterday and today are missing in user profile
Post by: emanuele on August 29, 2014, 05:12:28 am
hmm... it looks like this section uses the strings from Who.<language>.php
Title: Re: [RC2] yesterday and today are missing in user profile
Post by: emanuele on August 31, 2014, 09:37:54 am
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:
			$action = determineActions($user_profile[$memID]['url']);
loadLanguage('index');

@Spuds any other idea?
Title: Re: [RC2] yesterday and today are missing in user profile
Post by: Spuds on August 31, 2014, 02:46:09 pm
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.
Title: Re: [RC2] yesterday and today are missing in user profile
Post by: emanuele on August 31, 2014, 03:26:12 pm
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
Title: Re: [RC2] yesterday and today are missing in user profile
Post by: Jorin on September 02, 2014, 02:59:27 am
So no chance to fix this?
Title: Re: [RC2] yesterday and today are missing in user profile
Post by: emanuele on September 02, 2014, 05:00:04 am
I wrote the fix in the reply #6... why do you read it is not going to be fixed? ???
Title: Re: [RC2] yesterday and today are missing in user profile
Post by: Jorin on September 02, 2014, 05:06:06 am
Oops, I lost track. :-[  So it will be changed as described in #6. Good!
Title: Re: [RC2] yesterday and today are missing in user profile
Post by: emanuele on September 02, 2014, 03:17:36 pm
https://github.com/emanuele45/Dialogo/commit/e2caaf25eac0cd3b5de0da43312875dfcb67078c