You are here: Home » Topic » FireStats – Top 40 php script (now with added charts)page 10

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

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

Viewing 15 posts - 136 through 150 (of 176 total)
  • Author
    Posts
  • #14824
    sonichouse
    Participant

    @wynni wrote:

    hey,

    i use the last version of firestats (1.28) and i have modified the function.php.

    $DSN=”sqlite:/usr/var/cache/mt-daapd/songs.db”;
    I am sure i have sqlite2 !! also i have installed the packet for php-sqlite, but i don´t no what is POD. Witch packet i need?

    Hi there,

    i am not an expert with Apache, but you need support for PDO to be compiled.

    You also need to add

    extension=pdo.so

    to your php.ini file.

    #14825
    revjoe
    Guest

    I see that the demo site is running 1.28. Is this the same version that is in the zip?

    Thanks

    revjoe

    #14826
    sonichouse
    Participant

    @revjoe wrote:

    I see that the demo site is running 1.28. Is this the same version that is in the zip?

    Thanks

    revjoe

    Yes, 1.28 is the latest (not so recent now) release.
    See the link to the zip file in my signature below.

    #14827
    Anonymous
    Inactive

    Ok, I’m stumped. I’m not exactly a PHP noob, but I just can’t make this work.

    I’m running WHS, and I’ve done all of the installs to get PHP up and running. I’ve made a PHP test script and also tested PHPINFO and I know that PHP is working correctly.

    I’ve set my getDatabase() function as below:

    function getDatabase()
    {
    global $config;
    $DSN="sqlite:C:/Program Files/Firefly Media Server/songs3.db";
    trace($DSN, __FILE__, __LINE__);
    $dbh = new PDO($DSN);
    $dbh->exec('SET CHARACTER SET UTF8');

    return $dbh;
    }

    My FireStats files are located in C:Inetpubwwwroot, and FireFly and the songs3.db file are in C:Program FilesFirefly Media Server.

    PHP extensions are enabled for pod, sqlite, among others, and I’ve put the libchart-1.2.1 folder in C:Inetpubwwwroot, and updated line 77 in functions.php to show libchart-1.2.1 as opposed to libchart-1.2.

    I’ve also confirmed that the host and port are set right in getFirefly() by going to the xmlDoc location directly which gives me a valid XML output:


    200
    2.0.0
    3.0.0
    1800
    Music Server
    2
    0
    0
    0
    0
    0
    1

    When I go to any of the FireStats files, for example firefly.php, it just sits there thinking for about 15-20 seconds, then stops and the screen is just blank. No errors, no reporting, no nothing. Any ideas on what I can try to make this work?

    Edit: Forgot to mention, I’m on FireFly Version svn-1586

    #14828
    sonichouse
    Participant

    Hi there,

    not sure why it should bail out like that ?

    Is there any errors reported in your php log ?

    You can turn on debug by editing your firestats.ini

    e.g.

    [FIREFLY]
    port=3689
    host=localhost
    DSN = sqlite:/opt/var/mt-daapd/songs3.db

    [API]
    Lib=2

    [General]
    Debug=1

    this will dump relevant states and sql statements out for you.

    /Steve

    #14829
    Anonymous
    Inactive

    I’ve been playing around with it a bit and now I’ve got this in my php error log:

    [05-Oct-2008 15:08:28] PHP Fatal error:  Class 'PDO' not found in C:Inetpubwwwrootfunctions.php on line 103

    This is an excerpt from my php.ini… which PDO extension am I missing?

    extension=php_pdo.dll
    extension=php_pdo_firebird.dll
    extension=php_pdo_mssql.dll
    extension=php_pdo_mysql.dll
    extension=php_pdo_oci.dll
    extension=php_pdo_oci8.dll
    extension=php_pdo_odbc.dll
    extension=php_pdo_pgsql.dll
    extension=php_pdo_sqlite.dll
    extension=php_pdo_sqlite_external.dll
    extension=php_pdo_user.dll
    extension=php_pdo_informix.dll
    #14830
    sonichouse
    Participant

    That seems fine to me, is the php_pdo.dll in your class path (extension_dir in php.ini) ?

    The info at http://uk.php.net/manual/en/pdo.installation.php may be of use to you ?

    #14831
    Anonymous
    Inactive

    Yes, the php_pdo.dll file is there, and I followed the instructions from php.net, although the windows install is just “copy the file to /ext and add it to the php.ini file…

    I’m getting output now, but just the nav header. My php error log is still complaining about the POD class missing…

    Any thoughts?

    #14832
    sonichouse
    Participant

    I am not running windows here, but http://www.corephp.co.uk/archives/36-A-Guide-to-using-PHP-5-Extensions-on-Windows.html suggests that even though you have the correct extension_dir specified you need to add that path to your environment variable $PATH

    #14833
    Anonymous
    Inactive

    Ok, thanks to your link, it looks like PDO is working now, but I’m getting more errors in my php log now…

    [05-Oct-2008 17:23:56] PHP Warning:  domdocument::domdocument() expects at least 1 parameter, 0 given in C:Inetpubwwwrootfunctions.php on line 113

    [05-Oct-2008 17:23:56] PHP Fatal error: Call to undefined method domdocument::load() in C:Inetpubwwwrootfunctions.php on line 114

    113 is the $xmlDoc = new DOMDocument(); line…

    function getFirefly($FFhost="cosmos", $FFport=9999)
    {
    $firefly="Firefly";

    $xmlDoc = new DOMDocument();
    $xmlDoc->load("http://$FFhost:$FFport/server-info?output=xml");
    $x = $xmlDoc->documentElement;

    foreach ($x->childNodes AS $item)
    {
    if("$item->nodeName" == "dmap.itemname")
    $firefly=$item->nodeValue;
    }

    return $firefly;
    }

    But if I go to http://cosmos:9999/server-info?output=xml I get a valid XML output…

    #14834
    sonichouse
    Participant

    Ok, one step further into the Windows abyss …

    Reading http://uk2.php.net/manual/en/domdocument.construct.php it says

    Make sure that php_domxml.dll on windows is removed before using the domdocument class as they cannot coexist.

    HTH – Steve

    For compatabilty you may want to try

    $xmlDoc = new DOMDocument('1.0', 'UTF-8');

    this works on my linux server here.

    #14835
    Anonymous
    Inactive

    It looks like it’s working now! Taking php_domxml.dll out of the php.ini did it.

    I’m assuming the charts and such start over when you reboot the system. I rebooted my server, and the historical chart of items added to the library is there, but the play history charts are all blank.

    You sir are a good man! Thanks for taking the time to help me out!

    So if anyone is wondering, it took some fooling with, but this works on Windows Home Server with IIS and PHP5.

    #14836
    sonichouse
    Participant

    The charts are stored in the img directory from memory.

    If you run refresh, this will build all of the charts. By default they are not there until it has executed each report type.

    Glad that someone other than myself is using.

    Not sure if I remember correctly, but some of the earlier builds of FF did not update the played_count, so that may be why you are not seeing any data ?

    #14837
    Anonymous
    Inactive

    Yes, That could be it. I have accurate values for “Songs”, “Playlists”, and “Albums”, but zeros for “Albums Played”, “Songs Played”, and “Unique Songs Played”…

    I’m on build svn-1586… which build are you using?

    And what’s the upgrade procedure, just install the new version of FireFly over the old one so I don’t have to recreate the database?

    #14838
    sonichouse
    Participant

    @webdes03 wrote:

    Yes, That could be it. I have accurate values for “Songs”, “Playlists”, and “Albums”, but zeros for “Albums Played”, “Songs Played”, and “Unique Songs Played”…

    I’m on build svn-1586… which build are you using?

    And what’s the upgrade procedure, just install the new version of FireFly over the old one so I don’t have to recreate the database?

    I am using 1696 with sqlite3, and I must admit I have found this very stable on linux, but I cannot vouch for it on Windows.

    As far as I can remember there were no database changes for that build, so it should be a straight replacement. I would advocate making a backup copy of the database and ini files before embarking on any upgrades first though.

    Best of luck.

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