1
maxxy
seconds, minutes, days ago, Today
  • 2010/1/11 14:10

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


is there any quick hack to change the user last login in user info

to use advance timing ?

eg 1 seconds/minutes/days ago or today

right now display as

2010/1/11 22:09

2
ghia
Re: seconds, minutes, days ago, Today
  • 2010/1/11 16:18

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


It is not easy.
You have to modify /modules/profile/userinfo.php around
$value $fields[$i]->getOutputValue($thisUser$profile);

You have to check for the right variable by testing $i and then do an alternative formatting for the raw value, in the way NewBB does its date formatting.

3
maxxy
Re: seconds, minutes, days ago, Today
  • 2010/5/29 1:08

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


will be nice to be included in next version....

and option in admin panel will be nice

4
maxxy
Re: seconds, minutes, days ago, Today
  • 2012/12/25 12:58

  • maxxy

  • Quite a regular

  • Posts: 286

  • Since: 2007/6/11


can this be add to next core release ?

5
irmtfan
Re: seconds, minutes, days ago, Today
  • 2012/12/25 14:18

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


It is added years ago.
you have two ways to implement it in your website.
1- you can set "elapse" OR "e" as custom format in modules one by one. based on modules and module version it is different. eg: in newbb version 4.3 open newbb/include/plugin.php
// default manner will be used if not specified
$customConfig["formatTimestamp_custom"] = "elapse"// Could be set as "Y-m-d H:i"


2- change the $format = 'l' in formatTimestamp input to $format = 'elapse'
you have 2 way to implement it:
2-1- hack the core file located in xoops255/class/xoopslocal.php
function formatTimestamp($time$format 'e'$timeoffset null)


2-2- add the function to your locale.php in your language.
in xoops255/language/YOUR_LANG/locale.php

[code]
class XoopsLocal extends XoopsLocalAbstract
{
// some functions here
// ...
// ...

function formatTimestamp($time, $format = "elapse", $timeoffset = null)
{
// add your codes
}
// some functions here
// ...
// ...
}

I recommend the 2-2 because it is overall solution and you dont have to worry about touching core files.


Login

Who's Online

1204 user(s) are online (211 user(s) are browsing Support Forums)


Members: 0


Guests: 1204


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits