Exemple #1
0
function MG_xspf($aid)
{
    global $MG_albums, $_MG_CONF, $LANG_CHARSET;
    $xml = '';
    header("Content-type: text/xml; charset=" . $LANG_CHARSET);
    $xml .= "<?xml version=\"1.0\" encoding=\"" . $LANG_CHARSET . "\"?>\n";
    $xml .= "<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">\n";
    $xml .= "<title>" . $MG_albums[$aid]->title . "</title>";
    $xml .= "    <trackList>\n";
    $xml .= MG_getMP3Items($aid);
    $xml .= "    </trackList>\n";
    $xml .= "</playlist>\n";
    echo $xml;
}
Exemple #2
0
                $retval .= "            <identifier>" . $row['media_id'] . "</identifier>\n";
                $retval .= "            <location>" . $PhotoURL . "</location>\n";
                if ($media_thumbnail != '') {
                    $retval .= "            <image>" . $media_thumbnail . "</image>\n";
                } else {
                    if ($image != '') {
                        $retval .= "            <image>" . $image . "</image>\n";
                    }
                }
                $retval .= "        </track>\n";
            }
        }
        return $retval;
    }
}
/*
 * Main processing
 */
$aid = isset($_REQUEST['aid']) ? COM_applyFilter($_REQUEST['aid'], true) : 0;
$album_data = MG_getAlbumData($aid, array('skin', 'album_id', 'album_title', 'tn_attached'), true);
$xml = '';
$charset = COM_getCharset();
$xml .= "<?xml version=\"1.0\" encoding=\"" . $charset . "\"?>\n";
$xml .= "<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">\n";
$xml .= "<title>" . MG_escape($album_data['album_title']) . "</title>";
$xml .= "    <trackList>\n";
$xml .= MG_getMP3Items($album_data);
$xml .= "    </trackList>\n";
$xml .= "</playlist>\n";
header("Content-type: text/xml; charset=" . $charset);
echo $xml;