FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › Add-on Software › FireStats – Top 40 php script (now with added charts)
- This topic has 175 replies, 17 voices, and was last updated 15 years, 11 months ago by wwarren.
-
AuthorPosts
-
18/12/2007 at 4:39 AM #14799IrisParticipant
@sonichouse wrote:
wierd π
try
$ sqlite
SQLite version 2.8.16
Enter ".help" for instructions
sqlite> select datetime('now', 'localtime');
2007-12-16 21:38:22
sqlite> .quitSteve,
What can be done in the php code to simply manually correct for the time issue I’m having. I’m -6 hours UTC.
At least until I get things sorted out – this is a weird one. π
Iris
18/12/2007 at 6:58 AM #14800sonichouseParticipant@Iris wrote:
@sonichouse wrote:
wierd π
try
$ sqlite
SQLite version 2.8.16
Enter ".help" for instructions
sqlite> select datetime('now', 'localtime');
2007-12-16 21:38:22
sqlite> .quitSteve,
What can be done in the php code to simply manually correct for the time issue I’m having. I’m -6 hours UTC.
At least until I get things sorted out – this is a weird one. π
Iris
Hi Iris,
you could let the php server know your time zone information.
in php.ini try setting date.timezone to America/Chicago or wherever you need.
/Steve
19/12/2007 at 10:52 AM #14801sonichouseParticipant@Iris wrote:
Steve,
What can be done in the php code to simply manually correct for the time issue I’m having. I’m -6 hours UTC.
Iris
Hi there,
I have added timezone support to version 1.23
The times are now formated using the locale time offset hopefully.
Can you check it works for you.
It reads the php.ini date.timezone setting, or you can set in the code directly.
/Steve
19/12/2007 at 5:47 PM #14802IrisParticipantSteve,
I get this error on the Summary Page.
Fatal error: Class 'DateTimeZone' not found in /shares/mss-hdd/Public/Our Sites/stats/functions.php on line 653
I tried with my timezone (“America/Regina”) and also one of the defaults you had listed. I only edited the one line in Functions.php – was there another place I was supposed to change?
Glad to see you incorporated the time out setting – saves me having to add it in future releases.
I would of preferred setting the value in php.ini but the MSS seems to be more finnicky then the slug your using. It’s not supported as much as the slug and that sometimes causes more debugging. I did set the value in php.ini but that didn’t work so your solution of setting the timezone within the php code is my only option for now.
Iris
19/12/2007 at 6:10 PM #14803sonichouseParticipant@Iris wrote:
Steve,
I get this error on the Summary Page.
Fatal error: Class 'DateTimeZone' not found in /shares/mss-hdd/Public/Our Sites/stats/functions.php on line 653
I tried with my timezone (“America/Regina”) and also one of the defaults you had listed. I only edited the one line in Functions.php – was there another place I was supposed to change?
Glad to see you incorporated the time out setting – saves me having to add it in future releases.
I would of preferred setting the value in php.ini but the MSS seems to be more finnicky then the slug your using. It’s not supported as much as the slug and that sometimes causes more debugging. I did set the value in php.ini but that didn’t work so your solution of setting the timezone within the php code is my only option for now.
Iris
Hi Iris,
Ok can you replace your DateFromUTC function as
function DateFromUTC($value)
{
if(!isDate($value))
return $value;
$dateTimeZoneUTC = timezone_open("UTC");
$dateTimeZone = timezone_open(date_default_timezone_get());
$dateTimeUTC = date_create("now", $dateTimeZoneUTC);
$dateTime = date_create("now", $dateTimeZone);
$timeOffset = $dateTimeZone->getOffset($dateTimeUTC) . " seconds";
$d=Date("Y-m-d H:i:s",strtotime($value));
$dateTime = date_create($d);
$dateTime->modify($timeOffset);
return $dateTime->format("Y-m-d H:i:s");
}
the function calls require php 5.1 or greater, which version are you running ?.
You only need to set the timezone in the line that is commented out on line ~115.
Did you restart the web server/php after setting the value in php.ini ?
/Steve
[EDIT] Updated source to 1.24 with above changes [/EDIT]
20/12/2007 at 3:56 AM #14804IrisParticipantI’m running php5 v5.1.4-1. I created a php file on my lighttpd server with the code:
I created the php.ini (yeah, there wasn’t one to be found) file referenced in the above code adding date.timezone=”America/Regina” and rebooted – no luck. My phpinfo file even after rebooting still reports UTC as my timezone. This is what I mean by weird – I thought that should of done it.
Anyways, downloaded v1.24 and uncommented timezone for me (thanks) but I get a new error.
Fatal error: Call to undefined function timezone_open() in /shares/mss-hdd/Public/Our Sites/stats/functions.php on line 657
Your probably wondering like I did with the php.ini file – what the heck is going on….
Thanks for perserveering though and trying to correct this issue for me.
Iris
20/12/2007 at 9:56 AM #14805sonichouseParticipantHi Iris,
looks like you do not have date support ?
my phpinfo has a date section
date
date/time support enabled
"Olson" Timezone Database Version 2007.6
Timezone Database internal
Default timezone UTC
Directive Local Value Master Value
date.default_latitude 31.7667 31.7667
date.default_longitude 35.2333 35.2333
date.sunrise_zenith 90.583333 90.583333
date.sunset_zenith 90.583333 90.583333
date.timezone no value no value
just googling now
from http://www.w3schools.com/php/php_ref_date.asp
The date/time functions are part of the PHP core. There is no installation needed to use these functions.
20/12/2007 at 3:12 PM #14806IrisParticipantMy does too – this is from my phpinfo
date/time support enabled
Timezone Database Version 2006.1
Timezone Database internal
Default timezone UTC
Directive Local Value Master Value
date.default_latitude 31.7667 31.7667
date.default_longitude 35.2333 35.2333
date.sunrise_zenith 90.583333 90.583333
date.sunset_zenith 90.583333 90.583333
date.timezone no value no valueAt least I think this implies I have this functionality.
Iris
20/12/2007 at 3:28 PM #14807IrisParticipantHi Steve,
I wanted to investigate this some more so I used some example code from the link in your last post and created a time.php file with the code:
<?php
$t=time();
echo($t . "
");
echo(date("D F d Y",$t));
?>This is what I get…
1198164236
Thu December 20 2007That’s what its supposed to return and leads me to think that the date/time support is there. I was curious because I know that the MSS ipkg packages are very striped down versions – perhaps even more than the slug. That has caused me some problems in the past but is usually solved once I fiqure out what is missing/lacking.
Do you have any other ideas?
Iris
20/12/2007 at 3:36 PM #14808sonichouseParticipantHi Iris,
everthing I read on the web suggests these functions are available in 5.1.I know I am using 5.2 here on my slug.
Configuring php is by no means my area of competence π
-
AuthorPosts
- The forum ‘Add-on Software’ is closed to new topics and replies.