Subject: PHP Block heelp

Posted on: 24/05/03 04:06pm
By: Cregar

Hey all, I am needing some help. I just found a program that will export the current song I am listening to fron iTunes as a html page and upload it to my server. I would like to be able to atake that html page and imbed it into a php block. I know I need to add some code to the lib-custom file but honestly I have no clue what I would add to call the function. Any help would be apprecated. Cregar

PHP Block heelp

Posted on: 25/05/03 05:12am
By: Dirk

Well, not exactly what you're looking for, but I'm using KungTunes for the same thing and made this block to display the current song on my site:

function phpblock_iTunes () {
    global $_CONF;

    $retval = '';
    $trackinfo = $_CONF['path_html'] . "trackinfo.txt";

    if (file_exists ($trackinfo)) {
        $lines = file ($trackinfo);
        $retval = trim ($lines[0]);
        if ($retval == '--off--') {
            $retval = '';

    return $retval;

Pretty simple: KungTunes uploads a "trackinfo.txt" file containing the song information. This function reads it and displays it in a block (unless the file contains just "--off--", then the function doesn't return anything and the block vanishes).

Hope that helps.

bye, Dirk

Geeklog - Forum