Exemplo n.º 1
0
function write_songlist_struct($songlist_struct)
{
    // before we write, lets verify that all the files in here are really working files, that they exist at least...
    foreach ($songlist_struct as $tape => $songs) {
        foreach ($songs as $pos => $row) {
            if (!is_file(get_songs_path() . $row['filename'])) {
                error_log($row['filename'] . " is not accessible, removing it from the songlist");
                unset($songlist_struct[$tape][$pos]);
            }
        }
    }
    $songlist_struct_data = '<?php $songlist_struct_data = "' . base64_encode(serialize($songlist_struct)) . '"; ?>';
    $bytes_written = file_put_contents(constant("SETTINGS_PATH") . ".opentape_songlist.php", $songlist_struct_data);
    if ($bytes_written === false) {
        error_log("Unable to write songlist array");
        return false;
    } else {
        return true;
    }
}
Exemplo n.º 2
0
$info->appendChild($doc->createTextNode(get_base_url()));
$root->appendChild($info);
$location = $doc->createElement('location');
$location->appendChild($doc->createTextNode(get_base_url() . 'code/xspf.php'));
$root->appendChild($location);
$tracklist = $doc->createElement('trackList');
$root->appendChild($tracklist);
foreach ($songlist_struct[get_tape_path()] as $pos => $row) {
    if (!is_file(get_songs_path() . $row['filename'])) {
        unset($songlist_struct[$pos]);
        continue;
    }
    $trackitem = $doc->createElement('track');
    $tracklist->appendChild($trackitem);
    $location = $doc->createElement('location');
    $location->appendChild($doc->createTextNode(get_base_url() . get_songs_path() . rawurlencode($row['filename'])));
    $trackitem->appendChild($location);
    $meta = $doc->createElement('meta');
    $meta->appendChild($doc->createTextNode("mp3"));
    $meta->setAttribute("rel", "type");
    $trackitem->appendChild($meta);
    $creator = $doc->createElement('creator');
    if (isset($row['opentape_artist'])) {
        $creator->appendChild($doc->createTextNode($row['opentape_artist']));
    } else {
        $creator->appendChild($doc->createTextNode($row['artist']));
    }
    $trackitem->appendChild($creator);
    $title = $doc->createElement('title');
    if (isset($row['opentape_title'])) {
        $title->appendChild($doc->createTextNode($row['opentape_title']));
Exemplo n.º 3
0
?>
code/edit.php" method="post">
                        <input id="upload_input" name="file" type="file" /><input type="hidden" name="MAX_FILE_SIZE" value="<?php 
echo get_max_upload_bytes();
?>
" /><br />
                        <input type="submit" class="button" id="upload_button" value="Upload" />
                    </form>	
                </div>
                <div class="section">
                    <h2>Rearrange Songs</h2>		
                    <p><strong>Drag &amp; drop</strong> to change the order of your mixtape, it will save automatically.</p>
                    <ul class="sortie">
<?php 
foreach ($songlist_struct[get_tape_path()] as $pos => $row) {
    if (!is_file(get_songs_path() . $row['filename'])) {
        unset($songlist_struct[$pos]);
        continue;
    }
    ?>
                        <li id="<?php 
    echo $pos;
    ?>
">
                            <div class="name">
                                <span class="original_artist"><?php 
    if (isset($row['opentape_artist']) && !empty($row['opentape_artist'])) {
        echo $row['opentape_artist'];
    } elseif (!isset($row['opentape_artist']) && isset($row['artist'])) {
        echo $row['artist'];
    }
Exemplo n.º 4
0
    } elseif (!isset($row['opentape_artist']) && isset($row['artist'])) {
        echo $row['artist'] . " - ";
    }
    if (isset($row['opentape_title'])) {
        echo $row['opentape_title'];
    } else {
        echo $row['title'];
    }
    ?>
			</div>

			<?php 
    if (isset($prefs_struct['display_mp3']) && $prefs_struct['display_mp3'] == 1) {
        ?>
			<a class="mp3" href="<?php 
        echo $REL_PATH . get_songs_path() . rawurlencode($row['filename']);
        ?>
" target="_blank">MP3</a>
			<?php 
    } else {
        ?>
			&nbsp;
			<?php 
    }
    ?>

			<div class="info">
			<div class="clock"></div> <strong><?php 
    echo $row['playtime_string'];
    ?>
</strong>