예제 #1
0
    function trackTable($tracks, $showNumbers = true, $showArtist = false)
    {
        global $media_dir, $jinzora_skin, $hierarchy, $album_name_truncate, $row_colors, $img_more, $img_email, $img_rate, $img_discuss, $num_other_albums, $show_images, $jzUSER;
        if (sizeof($tracks) == 0) {
            return;
        }
        // Let's setup the new display object
        $display =& new jzDisplay();
        // Now let's setup the big table to display everything
        $i = 0;
        ?>
			<table class="jz_track_table" width="100%" cellpadding="3">
			<?php 
        foreach ($tracks as $child) {
            // First let's grab all the tracks meta data
            $metaData = $child->getMeta();
            ?>
				<tr class="<?php 
            echo $row_colors[$i];
            ?>
">				
					<td width="99%" valign="top" nowrap>
						<?php 
            $display->downloadButton($child);
            echo "&nbsp;";
            $display->playButton($child, false, false);
            echo "&nbsp;";
            if ($jzUSER->getSetting('stream')) {
                $display->link($child);
            } else {
                echo $child->getName();
            }
            echo " (" . convertSecMins($metaData['length']) . ")";
            ?>
					</td>
				</tr>
				<?php 
            $i = 1 - $i;
        }
        // Now let's set a field with the number of checkboxes that were here
        echo "</table>";
    }
예제 #2
0
 function trackTable($tracks)
 {
     global $show_artist_album, $show_track_num, $this_page;
     // Let's setup the objects
     $display =& new jzDisplay();
     // Let's get all the tracks
     $node = $tracks[0]->getAncestor('album');
     // Now let's loop through the track nodes
     foreach ($tracks as $track) {
         $meta = $track->getMeta();
         // Did they want track numbers?
         if ($show_track_num == "true") {
             // Now let's link to this track
             $number = $meta['number'];
             if ($number != "") {
                 echo $number . " - ";
             }
         }
         // Let's display the name of the track with a link to it using our display object
         $display->playLink($track, $meta['title']);
         echo " (" . convertSecMins($meta['length']) . ")<br>";
     }
 }
예제 #3
0
/**
 * Displays the status information on screen
 * during an update.
 * 
 * @author Ben Dodson
 * @version 11/13/04
 * @since 11/13/04
 */
function showStatus($path = false)
{
    global $word_importing;
    // Let's set our display items
    $media_display = str_replace("'", "", $path);
    // Now let's truncate the media_display
    if (strlen($media_display) > 60) {
        $media_display = substr($media_display, 0, 60) . "...";
    }
    switch ($_SESSION['jz_import_progress']) {
        case "30":
            $val = ".&nbsp;";
            $_SESSION['jz_import_progress'] = 0;
            break;
        default:
            $i = 0;
            $val = "";
            while ($i < $_SESSION['jz_import_progress']) {
                $val .= ".&nbsp;";
                $i++;
            }
            break;
    }
    $_SESSION['jz_import_progress']++;
    if ($media_display != "") {
        ?>
			<script language="javascript">
				d.innerHTML = '<nobr><b><?php 
        echo word("Directory");
        ?>
:</b> <?php 
        echo $media_display;
        ?>
<nobr>';
			-->
			</SCRIPT>
			<?php 
    }
    // Now let's figure out what's left
    if ($_SESSION['jz_import_full_ammount'] != 0) {
        $left = round($_SESSION['jz_import_full_progress'] / $_SESSION['jz_import_full_ammount'] * 100);
    }
    if ($left > 0) {
        $left = $left - 1;
    }
    // Ok, now let's figure out the time
    // First how much time has elapsed
    $elapsed = time() - $_SESSION['jz_import_start_time'];
    if ($elapsed == 0) {
        $elapsed = 1;
    }
    // Ok, now how many files did we do in that time?
    $perTime = round($_SESSION['jz_import_full_progress'] / $elapsed);
    if ($perTime == 0) {
        $perTime = 1;
    }
    // Now how much is left
    $ammountLeft = $_SESSION['jz_import_full_ammount'] - $_SESSION['jz_import_full_progress'];
    // Now time left?
    $timeLeft = convertSecMins(round($ammountLeft / $perTime));
    ?>
		<script language="javascript">
			p.innerHTML = '<b><?php 
    echo word("Processing files") . ": " . $_SESSION['jz_import_full_progress'] . " (" . $left . "% - " . $timeLeft . ") &nbsp; " . $val;
    ?>
</b>';
		-->
		</SCRIPT>
		<?php 
    flushdisplay();
}
예제 #4
0
    function trackTable($tracks, $purpose = false)
    {
        global $media_dir, $jinzora_skin, $hierarchy, $album_name_truncate, $row_colors, $img_more, $img_email, $img_rate, $img_discuss, $num_other_albums, $enable_ratings, $this_site, $allow_clips, $root_dir, $jzUSER, $hide_id3_comments, $max_song_length, $enable_discussion, $max_song_name_length, $show_lyrics_links, $allow_send_email, $handle_compilations, $video_types, $show_track_numbers;
        if (sizeof($tracks) == 0) {
            return;
        }
        // Let's setup the new display object
        $display =& new jzDisplay();
        $tracks_only = array();
        foreach ($tracks as $track) {
            if (is_object($track)) {
                $tracks_only[] = $track;
            }
        }
        // Now let's see if this is a Audio, Video, or Photo node
        $video = true;
        foreach ($tracks_only as $track) {
            if (!preg_match("/\\.({$video_types})\$/i", $track->getDataPath())) {
                $video = false;
            }
        }
        if ($video) {
            $this->videoTable($tracks_only, $purpose);
            return;
        }
        // Let's figure out our settings:
        // First, set the defaults.
        $showNumbers = false;
        if ($show_track_numbers == "true") {
            $showNumbers = true;
        }
        $showArtist = false;
        $showAlbum = false;
        $showCheck = false;
        $showInfo = false;
        $showEmail = false;
        $showRate = false;
        $showDisc = false;
        $showAlbumNames = false;
        $trackTruncate = false;
        $showPlayCount = false;
        if ($enable_discussion == "true") {
            $showDisc = true;
        }
        $trackTruncate = $max_song_name_length;
        // Now adjust as needed:
        switch ($purpose) {
            case "generic":
                $showNumbers = false;
                break;
            case "album":
                $showCheck = true;
                $showInfo = true;
                $showPlayCount = true;
                $showEmail = true;
                break;
            case "search":
                $showCheck = true;
                $showArtist = true;
                $showInfo = true;
                $showEmail = true;
                $trackTruncate = 100;
                break;
            case "sample":
                // We only want to show album thumbs IF this artist has more than 1 album
                $parent = $tracks_only[0]->getParent();
                $gParent = $parent->getParent();
                $nodes = $gParent->getSubNodes("nodes");
                $showNumbers = false;
                $showAlbum = true;
                break;
            case "sample-all":
                $showNumbers = false;
                $showCheck = true;
                $showAlbumNames = true;
                $trackTruncate = 20;
                break;
        }
        if ($allow_send_email == "false") {
            $showEmail = false;
        }
        // Do we need to start the form
        if ($showCheck) {
            $node = $tracks_only[0]->getParent();
            ?>
			<form name="albumForm" action="<?php 
            echo urlize();
            ?>
" method="POST">
			<input type="hidden" name="<?php 
            echo jz_encode("action");
            ?>
" value="<?php 
            echo jz_encode("mediaAction");
            ?>
">
				<?php 
            if ($purpose != "search") {
                ?>
 
			  <input type="hidden" name="<?php 
                echo jz_encode("jz_path");
                ?>
" value="<?php 
                echo htmlentities(jz_encode($node->getPath("String")));
                ?>
">
				<?php 
            }
            ?>
			<input type="hidden" name="<?php 
            echo jz_encode("jz_list_type");
            ?>
" value="<?php 
            echo jz_encode("tracks");
            ?>
">
			<?php 
        }
        // Now let's setup the big table to display everything
        $i = 0;
        ?>
		  <table class="jz_track_table" width="100%" cellpadding="3" cellspacing="0" border="0">
		 <?php 
        $artists = array();
        if ($handle_compilations == "true") {
            foreach ($tracks_only as $child) {
                $a = $child->getMeta();
                if (!isNothing($a['artist'])) {
                    $artists[$a['artist']] = true;
                }
            }
        } else {
            foreach ($tracks_only as $child) {
                $a = $child->getAncestor('artist');
                if ($a !== false) {
                    $artists[strtoupper($a->getName())] = true;
                }
            }
        }
        if (sizeof($artists) > 1) {
            $multiArtist = true;
        } else {
            $multiArtist = false;
        }
        $first_label = true;
        foreach ($tracks as $child) {
            // is it a header?
            if (is_string($child)) {
                if (!$first_label) {
                    echo '<tr><td colspan="100">&nbsp;</td></tr>';
                }
                echo '<tr><td colspan="100">' . $child . '</td></tr>';
                $first_label = false;
                continue;
            }
            // Let's make sure this isn't a lofi track
            if (substr($child->getPath("String"), -9) == ".lofi.mp3" or substr($child->getPath("String"), -9) == ".clip.mp3") {
                continue;
            }
            // First let's grab all the tracks meta data
            $metaData = $child->getMeta();
            $album = $child->getParent();
            if (findPType($album) == "disk") {
                $album = $album->getParent();
            }
            $gParent = $album->getParent();
            $artist = getInformation($album, "artist");
            ?>
		   <tr class="<?php 
            echo $row_colors[$i];
            ?>
">
		   <?php 
            if ($showCheck and $jzUSER->getSetting('stream')) {
                $value = htmlentities(jz_encode($child->getPath("String")));
                ?>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <input type="checkbox" name="jz_list[]" value="<?php 
                echo $value;
                ?>
">
		   </td>
		   <?php 
            }
            ?>
		   
		   <td width="99%" valign="top" class="jz_track_table_songs_td" nowrap>
		   	<?php 
            echo $display->playButton($child);
            ?>
			 <?php 
            // Now, is there a lofi version?
            $loFile = substr($child->getDataPath("String"), 0, -4) . ".lofi.mp3";
            if (is_file($loFile) and $jzUSER->getSetting('stream')) {
                $lofi = new jzMediaTrack(substr($child->getPath("String"), 0, -4) . ".lofi.mp3");
                //echo '<td width="1%" valign="top" class="jz_track_table_songs_td">';
                echo $display->lofiPlayButton($lofi);
                //echo '</td>';
            }
            ?>
			   <?php 
            // Now, is there a clip version?
            $loFile = substr($child->getDataPath("String"), 0, -4) . ".clip.mp3";
            if (is_file($loFile) || $allow_clips == "true") {
                //echo '<td width="1%" valign="top" class="jz_track_table_songs_td">';
                echo $display->clipPlayButton($child);
                //echo '</td>';
            }
            ?>
			   
		   <?php 
            echo $display->downloadButton($child);
            ?>
		   <?php 
            // Do they want ratings?
            if ($enable_ratings == "true") {
                $display->rateButton($child);
            }
            if ($showInfo) {
                echo " ";
                $display->infoButton($child);
            }
            if ($showEmail and $jzUSER->getSetting('stream')) {
                $display->emailButton($child);
            }
            ?>
		   <?php 
            if ($showDisc) {
                ?>
		   <a class="jz_track_table_songs_href" href=""><?php 
                $display->displayDiscussIcon($child);
                ?>
</a>
		   <?php 
            }
            ?>
		   <?php 
            if ($showArtist !== false) {
                $j = 0;
                while ($j < sizeof($hierarchy) && $hierarchy[$j] != 'artist') {
                    $j++;
                }
                if ($j < sizeof($hierarchy)) {
                    $parent = $child;
                    while ($parent->getLevel() > $j + 1) {
                        $parent = $parent->getParent();
                    }
                    $display->link($parent, $parent->getName(), $parent->getName(), "jz_track_table_songs_href");
                    echo " / ";
                }
            }
            // This is where we display the name
            if ($multiArtist) {
                if ($handle_compilations == "true") {
                    $artistName = $metaData['artist'];
                    if (isNothing($artistName)) {
                        $artist = $child->getAncestor("artist");
                        if ($artist !== false) {
                            $artistName = $artist->getName();
                        }
                    }
                } else {
                    $artist = $child->getAncestor("artist");
                    if ($artist !== false) {
                        $artistName = $artist->getName();
                    }
                }
                if (isset($artistName)) {
                    $tName = $child->getName();
                    unset($artistName);
                } else {
                    $tName = $child->getName();
                }
            } else {
                $tName = $child->getName();
            }
            if ($trackTruncate) {
                $tName = returnItemShortName($tName, $trackTruncate);
            }
            if ($purpose == "search") {
                $album = $child->getAncestor("album");
                $display->link($album, $album->getName(), $album->getName(), "jz_track_table_songs_href");
                echo " / ";
            }
            if ($showNumbers) {
                echo $metaData['number'] . " -&nbsp;";
            }
            if ($jzUSER->getSetting('stream')) {
                if ($showAlbum) {
                    $descName = $album->getName() . " - " . $child->getName();
                } else {
                    $descName = $child->getName();
                }
                // $tName = $child->getName();
                $display->link($child, $tName, $descName, "jz_track_table_songs_href");
            } else {
                echo $tName;
            }
            // Did they want to see lyrics links?
            if ($show_lyrics_links == "true") {
                if ($metaData['lyrics'] != "") {
                    $urlArr = array();
                    $urlArr['jz_path'] = $child->getPath("String");
                    $urlArr['action'] = "popup";
                    $urlArr['ptype'] = "viewlyricsfortrack";
                    echo '<a href="' . urlize($urlArr) . '" onclick="openPopup(this, 450, 450); return false;"> - ' . word("Lyrics") . '</a>';
                }
            }
            // Now let's show the description if there is one
            if ($short_desc = $child->getShortDescription() and $hide_id3_comments == "false") {
                echo "<br>" . $short_desc;
            }
            if ($description = $child->getDescription()) {
                echo "<br>" . $description;
            }
            // Do they want ratings?
            /*if ($enable_ratings == "true"){
               		//$rating = $display->displayRating($child,true);
            		if ($rating){
            			//echo "<br>". $rating;
            		}
            		//unset($rating);
               }*/
            ?>
		   </td>
		   
		   <?php 
            $lyricsSearch = false;
            if (isset($_POST['search_type'])) {
                if ($_POST['search_type'] == "lyrics") {
                    $lyricsSearch = $_POST['search_query'];
                }
            }
            if (isset($_GET['search_type'])) {
                if ($_GET['search_type'] == "lyrics") {
                    $lyricsSearch = $_GET['search_query'];
                }
            }
            if ($lyricsSearch) {
                // Now let's get the lyrics back
                $lyrics = $child->getLyrics();
                // Now let's parse it out
                $lyrics = str_replace("Lyrics Provided by: Leo's Lyrics\nhttp://www.leoslyrics.com", "", $lyrics);
                $start = strpos(strtolower($lyrics), strtolower($lyricsSearch)) - 20;
                if ($start < 0) {
                    $start = 0;
                }
                $lyrics = "&nbsp; &nbsp; &nbsp; &nbsp;(..." . substr($lyrics, $start, strlen($lyricsSearch) + 40) . "...)";
                $lyrics = highlight($lyrics, $lyricsSearch);
                echo '<td width="6%" align="center" valign="top" class="jz_track_table_songs_td" nowrap>';
                echo $lyrics;
                echo '</td>';
            }
            ?>
		   
		   
		   <?php 
            if ($showAlbumNames) {
                echo '<td width="1%" class="jz_track_table_songs_td" nowrap>';
                $display->link($album, returnItemShortName($album->getName(), 20), $album->getName(), "jz_track_table_songs_href");
                echo '</td>';
            }
            ?>
		   
			<?php 
            if ($showPlayCount) {
                echo '<td width="1%" align="center" valign="top" class="jz_track_table_songs_td" nowrap>';
                if ($child->getPlayCount() != 0) {
                    echo $child->getPlayCount() . " " . word("Plays");
                } else {
                    echo " - ";
                }
                echo '</td>';
            }
            ?>
		   
		   
		   <td width="6%" align="center" valign="top" class="jz_track_table_songs_td" nowrap>
		   &nbsp; <?php 
            echo convertSecMins($metaData['length']);
            ?>
 &nbsp;
		   </td>
		   </tr>
		   <?php 
            $i = 1 - $i;
            unset($gParent);
            unset($album);
        }
        // Now let's set a field with the number of checkboxes that were here
        echo "</table>";
        // Now let's show the playlist bar if we should
        if ($showCheck) {
            $this->blockSpacer();
            $this->playlistBar();
            echo "</form>";
        }
    }
예제 #5
0
파일: blocks.php 프로젝트: jinzora/jinzora3
 /**
  * Displays a table of the given video tracks.
  *
  * @author Ross Carlson
  * @version 2.26.06
  * @since 2.26.06
  * @param array $tracks The array of objects of each track
  * @param $purpose The type of this track table. One of:
  * generic|album|search|sample|sample-all
  */
 function videoTable($tracks, $purpose = false)
 {
     global $web_root, $root_dir, $row_colors;
     $display = new jzDisplay();
     // Let's setup Smarty
     $smarty = smartySetup();
     // Let's define our variables
     $i = 0;
     foreach ($tracks as $child) {
         $metaData = $child->getMeta();
         $tArr[$i]['name'] = $display->returnShortName($child->getName(), 25);
         $tArr[$i]['length'] = convertSecMins($metaData['length']);
         $tArr[$i]['playlink'] = $display->playlink($child, $child->getName(), false, false, true, false, true);
         $tArr[$i]['downloadlink'] = $display->downloadButton($child, true, false, false, true);
         $tArr[$i]['i'] = $i;
         $art = $child->getMainArt("125x125", true, "video");
         if ($art) {
             $tArr[$i]['art'] = $art;
         } else {
             $tArr[$i]['art'] = false;
         }
         $tArr[$i]['playcount'] = $child->getPlayCount();
         $i++;
     }
     $smarty->assign('tracks', $tArr);
     $smarty->assign('i', 0);
     $smarty->assign('cols', 3);
     $smarty->assign('jz_row1', $row_colors[1]);
     $smarty->assign('jz_row2', $row_colors[2]);
     $smarty->assign('word_watch_now', word("Watch Now"));
     $smarty->assign('word_download', word("Download"));
     $smarty->assign('word_viewed', word("Viewed"));
     // Now let's include the template
     $smarty->display(SMARTY_ROOT . 'templates/slick/videotable.tpl');
 }
예제 #6
0
    function trackTable($tracks, $purpose = false)
    {
        global $row_colors, $jinzora_skin, $root_dir, $show_artist_album, $show_track_num, $this_page;
        // Let's setup the objects
        $display =& new jzDisplay();
        // Now lets setup our form
        // First we need to know the node for these tracks
        // We can create this by getting the ancestor from the first track
        $node = $tracks[0]->getAncestor('album');
        if (!$node) {
            $node = $tracks[0]->getParent();
        }
        ?>
			<form name="albumForm" action="<?php 
        echo $this_page;
        ?>
" method="POST">
			<input type="hidden" name="<?php 
        echo jz_encode("action");
        ?>
" value="<?php 
        echo jz_encode("mediaAction");
        ?>
">
			<input type="hidden" name="<?php 
        echo jz_encode("jz_path");
        ?>
" value="<?php 
        echo htmlentities(jz_encode($node->getPath("String")));
        ?>
">
			<input type="hidden" name="<?php 
        echo jz_encode("jz_list_type");
        ?>
" value="<?php 
        echo jz_encode("tracks");
        ?>
">
			<?php 
        $i = 0;
        // Counter
        // Now let's loop through the track nodes
        foreach ($tracks as $track) {
            // Let's get the meta data
            // This will return the meta data (like length, size, bitrate) into a keyed array
            $meta = $track->getMeta();
            // Now let's display
            ?>
				<table width="100%" cellspacing="0" cellpadding="4">
					<tr class="<?php 
            echo $row_colors[$i];
            $i = 1 - $i;
            ?>
">
						<td width="1" valign="top">
							<input type="checkbox" name="jz_list[]" value="<?php 
            echo jz_encode($track->getPath("String"));
            ?>
">
						</td>
						<td width="1" valign="top">
							<?php 
            // Now let's link to download this track
            $display->downloadButton($track);
            ?>
						</td>
						<td width="1" valign="top" align="right">
							<?php 
            // Did they want track numbers?
            if ($show_track_num == "true") {
                // Now let's link to this track
                $number = $meta['number'];
                if ($number != "") {
                    if (strlen($number) < 2) {
                        echo "&nbsp;";
                    }
                    echo $number . ". ";
                }
            }
            ?>
						</td>
						<td width="100%" valign="top">
							<?php 
            // Let's display the name of the track with a link to it using our display object
            echo "<nobr>";
            $display->playLink($track, $meta['title']);
            echo "</nobr>";
            if ($show_artist_album == "true") {
                echo "<br>";
                // Now let's get the parents
                $parent = $track->getAncestor("album");
                $gparent = $track->getAncestor("artist");
                if ($parent !== false) {
                    $txt1 = $parent->getName();
                } else {
                    $txt1 = "";
                }
                if ($gparent !== false) {
                    $txt2 = $gparent->getName();
                } else {
                    $txt2 = "";
                }
                if ($txt1 != "" && $txt2 != "") {
                    $split = " - ";
                } else {
                    $split = "";
                }
                echo '<div style="font-size:9px;"><nobr>' . $txt2 . $split . "</nobr><nobr>" . $txt1 . '</nobr></div>';
            }
            ?>
						</td>	
						<td width="1" valign="middle" nowrap align="right">
							
						</td>
						<td width="1" valign="top" nowrap align="right">
							<table width="100%" cellspacing="5" cellpadding="0">
								<tr>
									<td align="right" valign="middle" nowrap>
										<div style="font-size: 8px;">
										<?php 
            // Now let's link to this track
            echo convertSecMins($meta['length']);
            echo ' &#183; ';
            echo $meta['bitrate'] . " Kbit/s";
            echo ' &#183; ';
            echo $meta['size'] . " MB";
            echo ' &#183; ';
            $eArr = explode(".", $meta['filename']);
            echo strtoupper($eArr[count($eArr) - 1]);
            echo " ";
            ?>
										</div>	
									</td>
									<td align="left" valign="middle">
										<?php 
            $display->playButton($track);
            ?>
									</td>
								</tr>
							</table>						
						</td>
					</tr>
				</table>
				<table width="100%" cellspacing="0" cellpadding="0"><tr bgcolor="#D2D2D2"><td width="100%"></td></tr></table>
				<?php 
        }
        // a bit of a hack.. don't know why this wasn't here.
        if ($purpose == "search") {
            $this->playlistBar();
            echo "</form>";
        }
        $this->blockSpacer();
    }
예제 #7
0
function smartyTrack($e)
{
    $display = new jzDisplay();
    // meta
    $arr = $e->getMeta();
    if (!is_array($arr)) {
        $arr = array();
    }
    $arr['length'] = convertSecMins($arr['length']);
    $arr['name'] = $e->getName();
    if (actionIsQueue()) {
        $arr['openPlayTag'] = $display->getOpenAddToListTag($e);
    } else {
        $arr['openPlayTag'] = $display->getOpenPlayTag($e);
    }
    return $arr;
}
예제 #8
0
										
									// Now let's not go over
									if (seconds < <?php 
    echo $curTrackLength;
    ?>
){
										t.innerHTML = converTime(seconds) + "/<?php 
    echo convertSecMins($curTrackLength);
    ?>
";
									} else {
										t.innerHTML = "<?php 
    echo convertSecMins($curTrackLength);
    ?>
/<?php 
    echo convertSecMins($curTrackLength);
    ?>
";
										<?php 
    writeLogData("messages", "Jukebox block: Refreshing the jukebox display");
    ?>
										seconds = 1;
										updateJukebox(true);
									}
									setTimeout("displayCountdown()",1000);
								} 
								displayCountdown();
								--> 
							</script> 
							<?php 
}
예제 #9
0
function drawPage(&$node)
{
    global $media_dir, $jinzora_skin, $hierarchy, $album_name_truncate, $row_colors, $img_download, $img_more, $img_email, $img_play, $img_random_play, $img_rate, $img_discuss, $num_other_albums, $root_dir, $enable_ratings, $short_date, $jzUSER, $img_play_dis, $img_random_play_dis, $img_download_dis, $show_similar, $show_radio, $jzSERVICES, $show_album_art, $this_page;
    // Let's setup the new display object
    $display =& new jzDisplay();
    $blocks =& new jzBlocks();
    $fe =& new jzFrontend();
    $parent = $node->getAncestor("artist");
    ?>
			
		<table width="100%" cellpadding="5" cellspacing="0" border="0">
			<tr>
				<td>
					<table width="100%" cellpadding="5" cellspacing="0" border="0">
						<tr>
							<td class="jz_block_td" nowrap colspan="4">
								<strong>SEARCH RESULTS AND OPTIONS</strong>
							</td>
						</tr>
						<tr>
							<?php 
    if (($art = $node->getMainArt("100x100")) !== false) {
        echo '<td width="1%" class="jz_nj_block_body" align="center" rowspan="2">';
        $display->playLink($node, $display->returnImage($art, $node->getName(), 100, 100, "fit"));
        echo '</td>';
    }
    ?>
							<td width="33%" class="jz_nj_block_body" align="center">
								<?php 
    echo $node->getSubNodeCount();
    ?>
 Track(s) Found.
							</td>
							<td width="33%" class="jz_nj_block_body" align="center">
								Page 1 of 1
							</td>
							<td width="33%" class="jz_nj_block_body" align="center">
								<?php 
    $stats = $node->getStats();
    echo $stats['total_length_str'];
    echo " for ";
    echo $stats['total_size_str'];
    ?>
							</td>
						</tr>
						<tr>
							<td width="25%" class="jz_nj_block_body" align="center">
								<a onClick="CheckBoxes('tracklist',true);" href="javascript:void()">Select All</a>
							</td>
							<td width="25%" class="jz_nj_block_body" align="center">
								<a onClick="CheckBoxes('tracklist',false);" href="javascript:void()">Release All</a>
							</td>
							<td width="25%" class="jz_nj_block_body" align="center">
									<a onClick="document.tracklist.randomize.value = 'false'; <?php 
    echo $display->embeddedFormHandler('tracklist');
    ?>
 document.tracklist.submit();" href="javascript:void()"><?php 
    echo word('Play');
    ?>
</a>
									 | 
									<a onClick="document.tracklist.randomize.value = 'true';  <?php 
    echo $display->embeddedFormHandler('tracklist');
    ?>
 document.tracklist.submit();" href="javascript:void()"><?php 
    echo word('Randomize');
    ?>
</a>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		
		<table width="100%" cellpadding="5" cellspacing="0" border="0">
			<tr>
				<td>
					<table width="100%" cellpadding="5" cellspacing="0" border="0">
						<tr>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
							
							</td>
							<td width="25%" align="center" class="jz_nj_block_body" style="border-top: 1px solid black;">
								<a href="#pageBottom">To Bottom</a>
							</td>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
								
							</td>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
							
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>

		<table width="100%" cellpadding="5" cellspacing="0" border="0">
			<tr>
				<td>
					<table width="100%" cellpadding="3" cellspacing="0" border="0">
						<tr>
							<td class="jz_block_td" nowrap>
								<strong>Options</strong>
							</td>
							<td class="jz_block_td" nowrap>
								<strong>Track Name</strong>
							</td>
							<td class="jz_block_td" nowrap>
								<strong>Time</strong>
							</td>
							<td class="jz_block_td" nowrap>
								<strong>Artist</strong>
							</td>
							<td class="jz_block_td" nowrap>
								<strong>Album</strong>
							</td>
							<td class="jz_block_td" nowrap align="center">
								<strong>#</strong>
							</td>
							<td class="jz_block_td" nowrap>
								<strong>Genre</strong>
							</td>
						</tr>
						
						<form name="tracklist" method="POST" action="<?php 
    echo urlize(array());
    ?>
">
						<input type="hidden" name="<?php 
    echo jz_encode("action");
    ?>
" value="<?php 
    echo jz_encode("mediaAction");
    ?>
">
						<input type="hidden" name="<?php 
    echo jz_encode("jz_path");
    ?>
" value="<?php 
    echo htmlentities(jz_encode($node->getPath("String")));
    ?>
">
						<input type="hidden" name="<?php 
    echo jz_encode("jz_list_type");
    ?>
" value="<?php 
    echo jz_encode("tracks");
    ?>
">
							    <input type="hidden" name="<?php 
    echo jz_encode("sendList");
    ?>
" value="<?php 
    echo jz_encode("true");
    ?>
">
							    <input type="hidden" name="randomize" value="false">
						<?php 
    $tracks = $node->getSubNodes('tracks', -1);
    foreach ($tracks as $track) {
        $meta = $track->getMeta();
        echo '<tr><td nowrap width="1%" class="jz_nj_block_body" valign="top">';
        echo '<input type="checkbox" name="jz_list[]" value="' . jz_encode($track->getPath("String")) . '" style="width:10px;height:10px;">';
        $display->playButton($track);
        echo " ";
        $display->downloadButton($track);
        echo '</td><td class="jz_nj_block_body" >';
        $display->playLink($track, $track->getName(), "Play " . $track->getName());
        echo '</td><td width="1%" class="jz_nj_block_body" align="center">';
        echo convertSecMins($meta['length']);
        echo '</td><td class="jz_nj_block_body" >';
        $artist = $track->getAncestor("artist");
        if ($artist) {
            $display->playButton($artist);
            echo " ";
            $display->randomPlayButton($artist);
            echo " ";
            $display->link($artist, $artist->getName());
        } else {
            echo $meta['artist'];
        }
        echo '</td><td class="jz_nj_block_body" >';
        $display->playButton($node);
        echo " ";
        $display->randomPlayButton($node);
        echo " ";
        $display->downloadButton($node);
        echo " ";
        $display->link($node, $node->getName());
        echo '</td><td nowrap width="1%" align="center" class="jz_nj_block_body" >';
        echo $meta['number'];
        echo '</td><td class="jz_nj_block_body" >';
        if ($artist === false) {
            $genre = false;
        } else {
            $genre = $artist->getAncestor("genre");
        }
        if ($genre) {
            $display->playButton($genre);
            echo " ";
            $display->randomPlayButton($genre);
            echo " ";
            $display->link($genre, $genre->getName());
        } else {
            if (!isNothing($meta['genre'])) {
                echo $meta['genre'];
            } else {
                echo '&nbsp;';
            }
        }
        echo '</td></tr>';
    }
    ?>
					</table>
					</form>
				</td>
			</tr>
		</table>

		<table width="100%" cellpadding="5" cellspacing="0" border="0">
			<tr>
				<td>
					<table width="100%" cellpadding="5" cellspacing="0" border="0">
						<tr>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
							
							</td>
							<td width="25%" align="center" class="jz_nj_block_body" style="border-top: 1px solid black;">
								<a href="#pageTop">To Top</a>
							</td>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
								
							</td>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
							
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<?php 
}
예제 #10
0
    /**
     * Displays a table of the given tracks.
     *
     * @author Ross Carlson
     * @version 11/30/04
     * @since 01/11/05
     * @param array $tracks The array of objects of each track
     * @param $purpose The type of this track table. One of:
     * generic|album|search|sample|sample-all
     */
    function trackTable($tracks, $purpose = false)
    {
        global $media_dir, $jinzora_skin, $hierarchy, $album_name_truncate, $row_colors, $img_more, $img_email, $img_rate, $img_discuss, $num_other_albums, $enable_ratings, $this_site, $root_dir;
        if (sizeof($tracks) == 0) {
            return;
        }
        // Let's setup the new display object
        $display =& new jzDisplay();
        // Let's figure out our settings:
        // First, set the defaults.
        $showNumbers = true;
        $showArtist = false;
        $showAlbum = false;
        $showCheck = false;
        $showInfo = false;
        $showEmail = false;
        $showRate = false;
        $showDisc = false;
        $albumArtThumbs = false;
        $showAlbumNames = false;
        $trackTruncate = false;
        $showPlayCount = false;
        // Now adjust as needed:
        switch ($purpose) {
            case "generic":
                $showNumbers = false;
                break;
            case "album":
                $showCheck = true;
                $showNumbers = false;
                $showInfo = true;
                $showPlayCount = true;
                $showEmail = true;
                break;
            case "search":
                $showArtist = true;
                break;
            case "sample":
                // We only want to show album thumbs IF this artist has more than 1 album
                $parent = $tracks[0]->getParent();
                $gParent = $parent->getParent();
                $nodes = $gParent->getSubNodes("nodes");
                if (count($nodes) > 1) {
                    $albumArtThumbs = true;
                }
                $showNumbers = false;
                $showAlbum = true;
                break;
            case "sample-all":
                $showNumbers = false;
                $showCheck = true;
                $showAlbumNames = true;
                $trackTruncate = 20;
                break;
        }
        // Do we need to start the form
        if ($showCheck) {
            $node = $tracks[0]->getParent();
            ?>
			<form name="albumForm" action="<?php 
            echo urlize();
            ?>
" method="POST">
			<input type="hidden" name="<?php 
            echo jz_encode("action");
            ?>
" value="<?php 
            echo jz_encode("mediaAction");
            ?>
">
			<input type="hidden" name="<?php 
            echo jz_encode("jz_path");
            ?>
" value="<?php 
            echo htmlentities(jz_encode($node->getPath("String")));
            ?>
">
			<input type="hidden" name="<?php 
            echo jz_encode("jz_list_type");
            ?>
" value="<?php 
            echo jz_encode("tracks");
            ?>
">
			<?php 
        }
        // Now let's setup the big table to display everything
        $i = 0;
        ?>
		  <table class="jz_track_table" width="100%" cellpadding="3" cellspacing="0" border="0">
		 <?php 
        foreach ($tracks as $child) {
            // First let's grab all the tracks meta data
            $metaData = $child->getMeta();
            $album = $child->getParent();
            if (findPType($album) == "disk") {
                $album = $album->getParent();
            }
            $gParent = $album->getParent();
            $artist = getInformation($album, "artist");
            ?>
		   <tr class="<?php 
            echo $row_colors[$i];
            ?>
">
		   <?php 
            if ($showCheck) {
                ?>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <input type="checkbox" name="jz_list[]" value="<?php 
                echo jz_encode($child->getPath("String"));
                ?>
">
		   </td>
		   
		   
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <?php 
                echo $display->playButton($child);
                ?>
		   </td>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <?php 
                echo $display->downloadButton($child);
                ?>
		   </td>
		   
		   
		   <?php 
            }
            // Do they want ratings?
            if ($enable_ratings == "true") {
                echo '<td width="1%" valign="top" class="jz_track_table_songs_td">';
                $display->rateButton($child);
                echo '</td>';
            }
            ?>
		  
		   <?php 
            if ($showInfo) {
                $arr = array();
                $arr['action'] = "popup";
                $arr['ptype'] = "trackinfo";
                $arr['jz_path'] = $child->getPath("String");
                $link = urlize($arr);
                ?>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <a href="<?php 
                echo $link;
                ?>
" target="_blank" onclick="openPopup(this, 375, 650); return false;"><?php 
                echo $img_more;
                ?>
</a>
		   </td>
		   <?php 
            }
            ?>
		   <?php 
            if ($showEmail) {
                ?>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <?php 
                $arr = array();
                $arr['action'] = "playlist";
                $arr['jz_path'] = $child->getPath("String");
                $arr['type'] = "track";
                $link = $this_site . $root_dir . "/" . str_replace("&", "%26", urlize($arr));
                $mailLink = "mailto:?subject=" . $artist . " - " . $album->getName() . "&body=Click to play " . $artist . " - " . $album->getName() . ":%0D%0A%0D%0A" . $link . "%0D%0A%0D%0APowered%20by%20Jinzora%20%0D%0AJinzora%20::%20Free%20Your%20Media%0D%0Ahttp://www.jinzora.org";
                ?>
		   <a class="jz_track_table_songs_href" href="<?php 
                echo $mailLink;
                ?>
"><?php 
                echo $img_email;
                ?>
</a>
		   </td>
		   <?php 
            }
            ?>
		   <?php 
            if ($showDisc) {
                ?>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <a class="jz_track_table_songs_href" href=""><?php 
                echo $img_discuss;
                ?>
</a>
		   </td>
		   <?php 
            }
            ?>
		   <td nowrap width="100%" valign="top" class="jz_track_table_songs_td">
		   <?php 
            // Do they want tiny thumbnails?
            if ($albumArtThumbs) {
                if (($art = $album->getMainArt()) !== false) {
                    $display->link($album, $display->returnImage($art, $album->getName(), 25, 25, "limit", false, false, "left", "2", "2"), $album->getName(), "jz_track_table_songs_href");
                }
            }
            if ($showArtist !== false) {
                $j = 0;
                while ($j < sizeof($hierarchy) && $hierarchy[$j] != 'artist') {
                    $j++;
                }
                if ($j < sizeof($hierarchy)) {
                    $parent = $child;
                    while ($parent->getLevel() > $j + 1) {
                        $parent = $parent->getParent();
                    }
                    $display->link($parent, $parent->getName(), $parent->getName(), "jz_track_table_songs_href");
                    echo " / ";
                }
            }
            if (!$trackTruncate) {
                $tName = $child->getName();
            } else {
                $tName = returnItemShortName($child->getName(), $trackTruncate);
            }
            $display->link($child, $tName, $child->getName(), "jz_track_table_songs_href");
            if ($showAlbum) {
                echo "<br>From: ";
                $display->link($album, returnItemShortName($album->getName(), 20), $album->getName(), "jz_track_table_songs_href");
            }
            // Do they want ratings?
            if ($enable_ratings == "true") {
                $rating = $display->displayRating($child, true);
                if ($rating) {
                    echo "<br>" . $rating;
                }
                unset($rating);
            }
            ?>
		   </td>
		   
		   <?php 
            $lyricsSearch = false;
            if (isset($_POST['search_type'])) {
                if ($_POST['search_type'] == "lyrics") {
                    $lyricsSearch = $_POST['search_query'];
                }
            }
            if (isset($_GET['search_type'])) {
                if ($_GET['search_type'] == "lyrics") {
                    $lyricsSearch = $_GET['search_query'];
                }
            }
            if ($lyricsSearch) {
                // Now let's get the lyrics back
                $lyrics = $child->getLyrics();
                // Now let's parse it out
                $lyrics = str_replace("Lyrics Provided by: Leo's Lyrics\nhttp://www.leoslyrics.com", "", $lyrics);
                $start = strpos(strtolower($lyrics), strtolower($lyricsSearch)) - 20;
                if ($start < 0) {
                    $start = 0;
                }
                $lyrics = "&nbsp; &nbsp; &nbsp; &nbsp;(..." . substr($lyrics, $start, strlen($lyricsSearch) + 40) . "...)";
                $lyrics = highlight($lyrics, $lyricsSearch);
                echo '<td width="6%" align="center" valign="top" class="jz_track_table_songs_td">';
                echo "<nobr>" . $lyrics . "</nobr>";
                echo '</td>';
            }
            ?>
		   
		   
		   <?php 
            if ($showAlbumNames) {
                echo '<td width="1%" align="center" valign="top" class="jz_track_table_songs_td"><nobr>';
                $display->link($gParent, returnItemShortName($gParent->getName(), 20), $gParent->getName(), "jz_track_table_songs_href");
                echo '</nobr></td>';
            }
            ?>
		   
			<?php 
            if ($showPlayCount) {
                echo '<td width="1%" align="center" valign="top" class="jz_track_table_songs_td">';
                echo $child->getPlayCount();
                echo '</td>';
            }
            ?>
		   
		   
		   <td width="6%" align="center" valign="top" class="jz_track_table_songs_td">
		   <nobr> &nbsp; <?php 
            echo convertSecMins($metaData['length']);
            ?>
 &nbsp; </nobr>
		   </td>
		   </tr>
		   <?php 
            $i = 1 - $i;
            unset($gParent);
            unset($album);
        }
        // Now let's set a field with the number of checkboxes that were here
        echo "</table>";
        // Now let's show the playlist bar if we should
        if ($showCheck) {
            $blocks = new jzBlocks();
            $blocks->blockSpacer();
            $blocks->playlistBar();
            echo "</form>";
        }
    }
예제 #11
0
        }
    }
    $array[$i]['track_name'] = $display->playLink($track, $meta['title'], false, false, true);
    $array[$i]['show_artist_album'] = $show_artist_album;
    // Now let's get the parents
    $parent = $track->getAncestor("album");
    $gparent = $track->getAncestor("artist");
    if (is_object($gparent)) {
        $array[$i]['artist'] = $gparent->getName();
    } else {
        $array[$i]['artist'] = "";
    }
    if (is_object($parent)) {
        $array[$i]['album'] = $parent->getName();
    } else {
        $array[$i]['album'] = "";
    }
    // Now let's link to this track
    $array[$i]['length'] = convertSecMins($meta['length']);
    $array[$i]['bitrate'] = $meta['bitrate'] . " Kbit/s";
    $array[$i]['size'] = $meta['size'] . " MB";
    $eArr = explode(".", $meta['filename']);
    $array[$i]['type'] = strtoupper($eArr[count($eArr) - 1]);
    $i++;
}
$smarty->assign('items', $array);
jzTemplate($smarty, "track-table");
// a bit of a hack.. don't know why this wasn't here.
if ($purpose == "search") {
    $this->playlistBar();
}
예제 #12
0
			<tr class="<?php 
echo $row_colors[$i];
$i = 1 - $i;
?>
">
				<td width="30%" valign="top">
					<nobr>
						<?php 
echo word('Track Length');
?>
:
					</nobr>
				</td>
				<td width="70%" valign="top">
					<?php 
echo convertSecMins($meta['length']);
?>
				</td>
			</tr>
			<tr class="<?php 
echo $row_colors[$i];
$i = 1 - $i;
?>
">
				<td width="30%" valign="top">
					<nobr>
						<?php 
echo word('Bit Rate');
?>
:
					</nobr>
예제 #13
0
				</td>
			</tr>
			<tr class="<?php 
echo $row_colors[$i];
$i = 1 - $i;
?>
">
				<td width="40%">
					<?php 
echo word("Average Track Length");
?>
:
				</td>
				<td width="60%">
					<?php 
echo convertSecMins($stats['avg_length']);
?>
				</td></tr>
<tr class="<?php 
echo $row_colors[$i];
$i = 1 - $i;
?>
">
<td width="40%">
				    <?php 
echo word("Average Bitrate");
?>
:
</td>
<td width="60%">
<?php 
예제 #14
0
						-->
					</SCRIPT>
					<?php 
            flushdisplay();
            // Now let's look at the art for this item and resize it if needed
            // BUT we don't want to create blank ones with this tool...
            $node->getMainArt($_POST['edit_resize_dim'], false);
            $i++;
        }
    }
    ?>
			<SCRIPT LANGUAGE=JAVASCRIPT><!--\
				ar = document.getElementById("artist");
				a = document.getElementById("album");
				ar.innerHTML = '<nobr><?php 
    echo word("Completed in") . " " . convertSecMins(time() - $start) . " " . word("seconds");
    ?>
</nobr>';					
				a.innerHTML = '<nobr><?php 
    echo word("Analyzed");
    ?>
: <?php 
    echo $i;
    ?>
</nobr>';							
				t.innerHTML = '&nbsp;';							
				-->
			</SCRIPT>
			<?php 
    flushdisplay();
    echo "<br><br><center>";