Advertisement:

Author Topic: ReTAD - Relative Time And Date (Facebook Styles)  (Read 21742 times)

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
ReTAD - Relative Time And Date (Facebook Styles)
« on: July 17, 2014, 03:47:03 PM »
Link to Mod

ReTAD - Relative Time And Date
- For SMF 1.1.x, 2.0.x and 2.1.x
- Non-Hook, Fully File Modifications.

1. Please do your own backup though every installation is backed up automatically.
2. This mod will try to improve normal SMF displayed time and date to a more relative one.
3. You may see post as just now, x minutes, hours, days, weeks or even year ago.
4. You can set this in forum as follows:
    a. Go to Admin CP > Features & Options > Layout & Options > Enable "Today" feature
    b. Select Relative Time And Date.
    c. Save your configuration.
5. You can test it in lower SMF version as well as SMF 2.1 too as it should work just fine. ;)

Thank you for using it.


Yours friendly,
Abu Fahim Ismail.

BSD License. Feel free to modify accordingly but keep author's link if it is in there somewhere. ;)

 

#Change log
@Version 1.2.3.1
-  Adding Italian language support, thanks to Ataru Moroboshi.

@Version 1.2.3
-  Fix reported error for not displaying correct a week / 1 week, thanks to Shuban.

@Version 1.2.2
-  Fix reported error for not displaying correct 2nd/3rd day, thanks to Shuban.

@Version 1.2.1
-  Fix reported error for not displaying correct 2nd day thanks to DSystem.
- Added Brazilian language thanks to DSystem.

@Version 1.2.0
-  Fix reported error for not displaying correct number of month and year thanks to Shuban.

@Version 1.1.1
- Added Spanish, Dutch & Malay languages thanks to 4Kstore & Soft Drink respectively.

@Version 1.1
- Changed on to about for $txt['on'] via language file Modifications.english.php.

#Note:
1. Translators can add up language by posting in the support page for this mod.
2. Only a complete language translation for both with details and without details packages will be add in the next updates. I will try to help a bit on this. ;)
« Last Edit: October 31, 2014, 02:40:14 AM by ahrasis »

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,430
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Improved Displayed Times (Facebook Styles)
« Reply #1 on: July 17, 2014, 04:09:40 PM »
Very nice mod, glad to see it's approved!

Just as a reference...to stay to SMF's coding style, you'd never do:
Code: [Select]
if($day_itv < 2) return $txt['itv_day'] . timeformat($log_time, $today_fmt, $offset_type);You'd always want to break that up into two lines. Just keeps it more clean and organized to see what's going on. You'd also want a space between if and ().

Regards

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: Improved Displayed Times (Facebook Styles)
« Reply #2 on: July 17, 2014, 04:37:30 PM »
Thank you for the feedback. I will take a note of that and improve it in the next version. Thanks again.

Offline 4Kstore

  • SMF Hero
  • ******
  • Posts: 4,298
  • Gender: Male
    • agustintari on Facebook
    • @agustintarifa on Twitter
    • SSIMPLE TEAM PAGE
Re: Improved Displayed Times (Facebook Styles)
« Reply #3 on: July 19, 2014, 09:07:31 PM »
This is a great mod.

My contribution: spanish_latin translation

Code: [Select]
$txt['itv_years'] = 'hace años';
$txt['itv_months'] = 'hace meses';
$txt['itv_weeks'] = 'hace semanas';
$txt['itv_days'] = 'hace días';
$txt['itv_hours'] = 'hace horas';
$txt['itv_minutes'] = 'hace minutos';
$txt['itv_year'] = 'Hace un año';
$txt['itv_month'] = 'Hace un mes';
$txt['itv_week'] = 'Hace una semana';
$txt['itv_day'] = 'Hace un día';
$txt['itv_hour'] = 'Hace una hora';
$txt['itv_minute'] = 'hace Un minuto';
$txt['itv_second'] = 'Recién!';
$txt['improved_times'] = 'Improved Displayed Times';

¡¡NEW MOD: Sparkles User Names!!!

Offline Charles Waters

  • Newbie
  • *
  • Posts: 5
Re: Improved Displayed Times (Facebook Styles)
« Reply #4 on: July 23, 2014, 12:54:14 PM »
Hey all:

I have a question about something related to this mod, but not exactly this mod (okay - now that you are as confused as I am by the way that sounded)...

I installed this GREAT mod, but I would like to do one more thing...

So now, the subs are set up looking like this:

Re: Testing
« Reply #3 on: 13 hours ago »


I would *really* love to be able to change it to this:

Re: Testing
« Reply #3: 13 hours ago »


Basically, getting rid of the "on" that is there. I have searched through a few of the source files where I would *think* the call to the "on: " would be, and I can not find it ANYWHERE.

Can anyone point me in the right direction?

Thanks in advance for the help, and thanks for an AWESOME mod!

Offline samborabora

  • Full Member
  • ***
  • Posts: 517
Re: Improved Displayed Times (Facebook Styles)
« Reply #5 on: July 23, 2014, 01:48:12 PM »
Hey all:

I have a question about something related to this mod, but not exactly this mod (okay - now that you are as confused as I am by the way that sounded)...

I installed this GREAT mod, but I would like to do one more thing...

So now, the subs are set up looking like this:

Re: Testing
« Reply #3 on: 13 hours ago »


I would *really* love to be able to change it to this:

Re: Testing
« Reply #3: 13 hours ago »


Basically, getting rid of the "on" that is there. I have searched through a few of the source files where I would *think* the call to the "on: " would be, and I can not find it ANYWHERE.

Can anyone point me in the right direction?

Thanks in advance for the help, and thanks for an AWESOME mod!

Check your Display.template.php for:

Code: [Select]
<div class="smalltext">&#171; <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ' ', $txt['on'], ':</strong> ', $message['time'], ' &#187;</div>
I believe if you change this to:
Code: [Select]
<div class="smalltext">&#171; <strong>', !empty($message['counter']) ? $txt['reply_noun'] . ' #' . $message['counter'] : '', ':</strong> ', $message['time'], ' &#187;</div>
:D

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: Improved Displayed Times (Facebook Styles)
« Reply #6 on: July 23, 2014, 08:18:06 PM »
Thank you for your feed back and suggestion. I will try to add this in the next update. I will check whether private message have the same thing because basically, it is almost similar with Display.template.php. May be, I consider removing it from language file instead. I will see which one is efficient and better.

Offline Charles Waters

  • Newbie
  • *
  • Posts: 5
Re: Improved Displayed Times (Facebook Styles)
« Reply #7 on: July 23, 2014, 08:45:06 PM »
Check your Display.template.php for:

DAMN IT!!! I didn't even see that file... Son of a ________________ (<-- insert favorite curse word here).

Offline iorkara

  • Semi-Newbie
  • *
  • Posts: 34
  • Sorry, we are open.
Re: Improved Displayed Times (Facebook Styles)
« Reply #8 on: July 26, 2014, 12:19:31 AM »
Installed this Mod, brilliant work.

Thank you.

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: Improved Displayed Times (Facebook Styles)
« Reply #9 on: July 26, 2014, 01:12:49 AM »
Thank you for the feedback.

I am still figuring out whether to remove $txt['on'] from language file or otherwise will have to mod 16 places in default templates. Simply removing txt['on'] from the language file will unfortunately leave a blank empty space. While modifying 16 places seems quite tedious. I guess I will just have to replace it with a "-" for the time being.

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Updated.

#Change log
Version 1.1
Change on to about for $txt['on'] via language file Modifications.english.php.

Note:
1. Translator can add up language by posting in the support page for this mod.
2. Only a complete language translation for both with details and without details packages will be add in the next updates.
3. Old packages are removed.

Thanks 4Kstore. But I will need translations for both packages instead of just one. Please update the translations so I could package them up together.
This is a great mod.

My contribution: spanish_latin translation

Code: [Select]
$txt['itv_years'] = 'hace años';
$txt['itv_months'] = 'hace meses';
$txt['itv_weeks'] = 'hace semanas';
$txt['itv_days'] = 'hace días';
$txt['itv_hours'] = 'hace horas';
$txt['itv_minutes'] = 'hace minutos';
$txt['itv_year'] = 'Hace un año';
$txt['itv_month'] = 'Hace un mes';
$txt['itv_week'] = 'Hace una semana';
$txt['itv_day'] = 'Hace un día';
$txt['itv_hour'] = 'Hace una hora';
$txt['itv_minute'] = 'hace Un minuto';
$txt['itv_second'] = 'Recién!';
$txt['improved_times'] = 'Improved Displayed Times';
« Last Edit: August 13, 2014, 04:22:24 AM by ahrasis »

Offline gaurav09

  • Semi-Newbie
  • *
  • Posts: 59
Re: Improved Displayed Times (Relative / Facebook Styles) SMF 2.0.x & 1.1.x
« Reply #11 on: August 13, 2014, 08:03:52 AM »
why "With details of time for a day to years." mod dropped   :o :o :o

i have installed this one,..is it giving any major error  ??? :o ???

should i uninstall it  ??? ??? ???

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: Improved Displayed Times (Relative / Facebook Styles) SMF 2.0.x & 1.1.x
« Reply #12 on: August 13, 2014, 09:04:51 AM »
No. So far that I have tested, it is has no trouble at all. I just don't feel there is necessity to maintain it beside it gives confusion to people who use this mod. I think it is better of with no details at all rather than one gives some time details and the other does not.

I will put it back in the mod page if anybody still need it. So sorry for the confusion.

Offline gaurav09

  • Semi-Newbie
  • *
  • Posts: 59
Re: Improved Displayed Times (Relative / Facebook Styles) SMF 2.0.x & 1.1.x
« Reply #13 on: August 13, 2014, 11:39:03 PM »
No. So far that I have tested, it is has no trouble at all. I just don't feel there is necessity to maintain it beside it gives confusion to people who use this mod. I think it is better of with no details at all rather than one gives some time details and the other does not.

I will put it back in the mod page if anybody still need it. So sorry for the confusion.
oh i was very scared  :'( :'( :'(
do not do these things in future  :'( :'( :'(
i am very scared  >:(

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: Improved Displayed Times (Relative / Facebook Styles) SMF 2.0.x & 1.1.x
« Reply #14 on: August 14, 2014, 12:26:07 AM »
So sorry. It shouldn't be scary or anything.

Offline Rain Forest

  • Full Member
  • ***
  • Posts: 657
  • 𝒢𝒾𝓇𝒶𝒻𝒻𝑒
    • Love Troops
Re: Improved Displayed Times (Relative / Facebook Styles) SMF 2.0.x & 1.1.x
« Reply #15 on: August 14, 2014, 04:58:17 AM »
Hey Ahraris :)

Thanks for the nice mod!

How do I remove the time date from boardindex (smf 2.0.8)?

For example
about A week ago at 05:06:58 PM

to: about A week ago

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: Improved Displayed Times (Relative / Facebook Styles) SMF 2.0.x & 1.1.x
« Reply #16 on: August 14, 2014, 05:06:47 AM »
Uninstall. Use ImprovedDisplayedTimesNoDetailsV11.zip instead. The one you used is ImprovedDisplayedTimesV11.zip which shows time details.

Offline Rain Forest

  • Full Member
  • ***
  • Posts: 657
  • 𝒢𝒾𝓇𝒶𝒻𝒻𝑒
    • Love Troops
Re: Improved Displayed Times (Relative / Facebook Styles) SMF 2.0.x & 1.1.x
« Reply #17 on: August 14, 2014, 07:31:25 AM »
Uninstall. Use ImprovedDisplayedTimesNoDetailsV11.zip instead. The one you used is ImprovedDisplayedTimesV11.zip which shows time details.
Oh, sorry! Didn't see that one before. Thanks :)

Offline ahrasis

  • SMF Hero
  • ******
  • Posts: 4,921
  • Gender: Male
  • Busy mode is on.
    • ahrasis on GitHub
    • ahrasis on LinkedIn
    • ElkArte Malaysia
Re: Improved Displayed Times (Relative / Facebook Styles) SMF 2.0.x & 1.1.x
« Reply #18 on: August 14, 2014, 09:33:16 AM »
That is why I am trying to drop the one with time details. It is a little bit confusing to have them both in there.

Offline Rain Forest

  • Full Member
  • ***
  • Posts: 657
  • 𝒢𝒾𝓇𝒶𝒻𝒻𝑒
    • Love Troops
Re: Improved Displayed Times (Relative / Facebook Styles) SMF 2.0.x & 1.1.x
« Reply #19 on: August 14, 2014, 10:14:11 AM »
That's ok :)

If you need the Dutch translation:

Code: [Select]
$txt['itv_years'] = ' jaar geleden';
$txt['itv_months'] = ' maanden geleden';
$txt['itv_weeks'] = ' weken geleden';
$txt['itv_days'] = ' dagen geleden';
$txt['itv_hours'] = ' uren geleden';
$txt['itv_minutes'] = ' minuten geleden';
$txt['itv_year'] = 'Een jaar geleden';
$txt['itv_month'] = 'Een maand geleden';
$txt['itv_week'] = 'Een week geleden';
$txt['itv_day'] = 'Een dag geleden';
$txt['itv_hour'] = 'Een uur geleden';
$txt['itv_minute'] = 'Een minuut geleden';
$txt['itv_second'] = 'Zojuist!';
$txt['improved_times'] = 'Verbeterde tijd weergave';
$txt['on'] = 'Over';
« Last Edit: October 18, 2014, 11:30:03 AM by .Elephant »