0

Hi, I would like to know how to create a dynamic xml playlist that is automatically updated as mp3 files are uploaded. I want the playlist for flabell29 flash mp3 player, which can be found at flabell.com. The playlist icludes album art location, artist name, track title, duration, album title and a web link. The mp3 info should be read from a txt file

2
Contributors
1
Reply
4
Views
5 Years
Discussion Span
Last Post by cereal
0

From this example file I see there is a tracks block in which you have to insert each mp3 data:

<tracks>
    <item id="11">
        <title>
        <![CDATA[ Mix Track 2 ]]>
        </title>
        <artist>
        <![CDATA[ feat. Eo ]]>
        </artist>
        <!--
        if you want this item to have a different artist(for example featuring artist write the text in this tag
        -->
        <duration>00:31</duration>
        <!--
        define this only if is the correct duration, otherwise it will make the song to jump incorrectly
        -->
        <buy price="0.99" url="http://www.flabell.com" target="_blank">Buy</buy>
        <!--
        if you want this item to have a different text then the general text, write the text in this tag if the url is empty then the button won't appear
        -->
        <song>content/songs/song1.mp3</song>
        <!--
        if you want to use RTMP streaming use this "song" tag like below
        -->
        <!--
        <song streamer = "rtmp://domain.com/app/">mp3:streamPath</song>
        -->
    </item>
</tracks>

The parent block is used to determine the album details:

<mp3gallery>
    <albums startAlbumNo="">
        <album id="1">
            <author>...</author>
            <image>content/images/albums/50 Cent.jpg</image>
            <name alsoInList="true">...</name>
            <caption>...</caption>
            <link>http://www.themesbell.com</link>
            <target>_blank</target>
            <!--...-->
            <buy price="9.99" target="">http://www.themesbell.com</buy>
            <!--...-->
            <tracks>...</tracks>
        </album>
    </albums>
</mp3gallery>

In order to add a song to an album you have to add an item block to tracks. From what I see in the linked file, each item has an id number and this cannot be repeated not even into another album of the same xml file, or at least this is what I see from this example. This is a bit strange behaviour, I would expect to reset the item counter id when starting a new album entry. It's a bit like a primary key of a table, unique and almost always incremental.

The xml output is not difficult to create with SimpleXML library and glob() function or through a database query, but check if there is a specification about the format of mp3gallery.xml file. I cannot find anything in the public part.

So, do you have a database table in which you save data (album details, mp3 filenames, ...)? And if yes paste here table structure and an example of data, you can use explain table_name in the MySQL client. The uploaded mp3 are saved into separated directories? Have you written some code? The more information you provide, the more helpful we can be. Bye!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.