Welcome to Geeklog, Anonymous Friday, November 29 2024 @ 02:40 pm EST

Geeklog Forums

PHP Block heelp


Status: offline

Cregar

Forum User
Junior
Registered: 03/31/02
Posts: 23
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
--
"Get Geeked"
Cregar
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany

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:

Text Formatted Code
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

 Quote

All times are EST. The time is now 02:40 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content