Message Open Statistics - Response Time in Days, Hours, ...

Solutions for other advanced phplisters

Message Open Statistics - Response Time in Days, Hours, ...

Postby dlynes » 3:29pm, Sat 05 Sep, 2009

I've modified the code to show response time in days, hours, minutes and seconds instead of just seconds.

It may or may not be good for languages other than English or French, as I'm not using the I18N globals array for the separators, but I hope you still find the code useful:

Replace line 136 in mviews.php:
$ls->addColumn($element,$GLOBALS['I18N']->get('responsetime'),$row['responsetime'].' '.$GLOBALS['I18N']->get('sec'));

With:
$rtdays=(int)($row['responsetime']/3600/24) ;
$rthours=(int)(($row['responsetime']-$rtdays*3600*24)/3600) ;
$rtminutes=(int)(($row['responsetime']-$rtdays*3600*24-$rthours*3600)/60) ;
$rtseconds=($row['responsetime']-$rtdays*3600*24-$rthours*3600-$rtminutes*60) ;
$ls->addColumn($element,$GLOBALS['I18N']->get('responsetime'),$rtdays . 'd:' . $rthours . 'h:' . $rtminutes . 'm:' . $rtseconds . 's');

Enjoy!
dlynes
PL Nut
 
Posts: 17
Joined: 8:25am, Sun 22 Feb, 2009
Location: Hamilton, ON, Canada

Re: Message Open Statistics - Response Time in Days, Hours, ...

Postby reus » 1:24pm, Wed 31 Mar, 2010

I use your code and enjoy it.
Thanks dlynes
reus
PL Nut
 
Posts: 18
Joined: 1:56am, Wed 13 May, 2009

Re: Message Open Statistics - Response Time in Days, Hours, ...

Postby H2B2 » 4:15pm, Sun 04 Jul, 2010

H2B2
Moderator
 
Posts: 7188
Joined: 1:51am, Wed 15 Mar, 2006


Return to Advanced Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 1 guest