$value) { if($key != "action") fputs($fp, "$key=$value\n"); } fclose($fp); } else { print("Cannot open file to save variables!"); } } // getMusicStr() returns a formatted string with // the contents of the AMIP vars file, as // defined above. // // $path is the path to the root of the site, // to allow for files in subdirs to successfully // access the script. // // $amip is the path from the root of the site // to the amip script directory. function getMusicStr($path, $amip) { global $songfile; $contents = file($path.$amip.$songfile); foreach($contents as $line) { $line = rtrim($line); list($key, $val) = split("=", $line); $SONG[$key] = stripslashes($val); } $prefix = " "; switch ($SONG['special']) { case "stop": return $prefix . "Not listening to anything now..."; case "pause": return $prefix . "Player is paused."; } $musicstr = $prefix . "$SONG[title] (Album: $SONG[album])"; return $musicstr; } ?>