FireStats – Top 40 php script (now with added charts)

FireFly Media Server Firefly Media Server Forums Firefly Media Server Add-on Software FireStats – Top 40 php script (now with added charts)

Viewing 10 posts - 111 through 120 (of 176 total)
  • Author
    Posts
  • #14799
    Iris
    Participant

    @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> .quit

    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.

    At least until I get things sorted out – this is a weird one. πŸ˜•

    Iris

    #14800
    sonichouse
    Participant

    @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> .quit

    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.

    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

    #14801
    sonichouse
    Participant

    @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

    #14802
    Iris
    Participant

    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

    #14803
    sonichouse
    Participant

    @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]

    #14804
    Iris
    Participant

    I’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

    #14805
    sonichouse
    Participant

    Hi 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.

    #14806
    Iris
    Participant

    My 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 value

    At least I think this implies I have this functionality.

    Iris

    #14807
    Iris
    Participant

    Hi 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 2007

    That’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

    #14808
    sonichouse
    Participant

    Hi 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 πŸ™

Viewing 10 posts - 111 through 120 (of 176 total)
  • The forum ‘Add-on Software’ is closed to new topics and replies.