function doTemplate($node) { $display =& new jzDisplay(); $smarty = mobileSmarty(); $breadcrumbs = array(); if (isset($_REQUEST['jz_path'])) { $me = $node; while ($me->getLevel() > 0) { $breadcrumbs[] = array("name" => $me->getName(), "link" => urlize(array('jz_path' => $me->getPath("String")))); $me = $me->getParent(); } } $breadcrumbs[] = array("name" => word("Home"), "link" => urlize(array())); $smarty->assign('breadcrumbs', $breadcrumbs); if (actionIsQueue()) { $smarty->assign('Play', word('Add')); } else { $smarty->assign('Play', word('Play')); } $myNodes = $node->getSubNodes('nodes'); sortElements($myNodes); $myTracks = $node->getSubNodes('tracks'); $nodes = array(); for ($i = 0; $i < sizeof($myNodes); $i++) { $e = $myNodes[$i]; $nodes[] = smartyNode($myNodes[$i]); } $smarty->assign('nodes', $nodes); $tracks = array(); for ($i = 0; $i < sizeof($myTracks); $i++) { $e = $myNodes[$i]; $tracks[] = smartyTrack($myTracks[$i]); } $smarty->assign('tracks', $tracks); jzTemplate($smarty, 'browse'); }
/** * Displays the grid of nodes for a standard page. * * @author Ben Dodson, Ross Carlson * @version 3/22/05 * @since 3/22/05 **/ function nodeGrid($node, $distance = false) { global $hierarchy; $smarty = smartySetup(); $display = new jzDisplay(); $lvl = isset($_GET['jz_letter']) ? $_GET['jz_level'] + $node->getLevel() - 1 : $node->getLevel(); switch ($hierarchy[$lvl]) { case "genre": $pg_title = word("Genres"); break; case "artist": $pg_title = word("Artists"); break; case "album": $pg_title = word("Albums"); break; default: $pg_title = word("Genres"); break; } if (isset($_GET['jz_letter'])) { $retArray = $node->getAlphabetical($_GET['jz_letter'], "nodes", $_GET['jz_level']); $letter = $_GET['jz_letter']; } else { $retArray = $node->getSubNodes("nodes", $distance); } sortElements($retArray, "name"); if ($node->getName() != "") { $pg_title = $node->getName(); if ($node->getSubNodeCount("nodes") > 0) { $pg_title .= " (" . $node->getSubNodeCount("nodes"); if ($node->getSubNodeCount("tracks") > 0) { $pg_title .= "+"; } $pg_title .= ")"; } } else { if (count($retArray) != 0) { $pg_title .= " (" . count($retArray) . ")"; } } if ($display->startCache("nodeGrid", $node->getName(), $letter)) { return; } $_SESSION['jz_node_distance'] = $distance; $smarty->assign('jz_bg_color', jz_bg_color); $smarty->assign('title', $pg_title); $smarty->display(SMARTY_ROOT . 'templates/slick/nodegrid.tpl'); // Now lets finish out the cache $display->endCache(); flushdisplay(); }
/** * Displays the block for the tracks on the Album page * * @author Ben Dodson, Ross Carlson * @since 9/6/05 * @version 9/6/05 * **/ function albumTracksBlock($node = false) { global $album_name_truncate, $img_play, $img_random_play, $img_play_dis, $img_random_play_dis, $jzUSER, $enable_ratings, $show_album_clip_play, $img_clip; $artist = false; if ($node != false) { $art = $node->getParent(); $artist = $art->getName(); } if (!defined('NO_AJAX_LINKS') && $node === false) { $node = new jzMediaNode($_SESSION['jz_path']); } if (!is_object($node)) { return; } $display = new jzDisplay(); // now let's set the title for this block $title = returnItemShortName($node->getName(), $album_name_truncate); // Now let's get the year $year = $node->getYear(); $dispYear = ""; if (!isnothing($year)) { $dispYear = " (" . $year . ")"; } // Now let's setup our buttons for later $playButtons = ""; $playButtons .= $display->playLink($node, $img_play, false, false, true) . $display->playLink($node, $img_random_play, false, false, true, true); // Now let's make sure they can stream if (!$jzUSER->getSetting('stream')) { $playButtons = $img_play_dis . $img_random_play_dis; } if ($show_album_clip_play == "true") { $playButtons .= $display->playLink($node, $img_clip, false, false, true, false, false, true); } if ($jzUSER->getSetting('download')) { $playButtons .= $display->downloadButton($node, false, true, true); } else { $playButtons .= $display->downloadButton($node, true, true, true); } $playButtons .= $display->podcastLink($node); if ($enable_ratings == "true") { $playButtons .= $display->rateButton($node, true); } $playButtons .= " "; $this->blockHeader("Tracks: " . $title . $dispYear, $playButtons); $this->blockBodyOpen(); // Now let's see if this is a multi-disc album $disks = $node->getSubNodes("nodes"); $all_tracks = array(); if (count($disks) > 0) { // Yep, it's a multi... foreach ($disks as $disk) { $disktracks = $disk->getSubNodes("tracks", -1); sortElements($disktracks, "number"); ob_start(); $display->playButton($disk); $display->link($disk, " <strong>" . $disk->getName() . "</strong><br>"); $header = ob_get_contents(); ob_end_clean(); // Now let's store the album name $all_tracks[] = $header; // Now let's display the tracks for this album foreach ($disktracks as $t) { $all_tracks[] = $t; } } } // Now let's read all the tracks for this album $tracks = $node->getSubNodes("tracks"); $all_tracks += $tracks; $this->trackTable($all_tracks, "album"); $this->blockBodyClose(); //$this->blockSpacer(); }
if (isset($_GET['mode']) && $_GET['mode'] == "radio") { // Let's set the limit $lim = isset($_GET['limit']) ? $_GET['limit'] : false; // Now let's get the tracks from the primary artist $el =& new jzMediaNode($_GET['jz_path']); $pl = new jzPlaylist(); $pl->add($el); $pl = $pl->getSmartPlaylist($lim, "radio"); $pl->play(); } else { $el =& new jzMediaNode($_GET['jz_path']); $rand = isset($_GET['mode']) && $_GET['mode'] == "random" ? true : false; $lim = isset($_GET['limit']) ? $_GET['limit'] : false; $tlist = $el->getSubNodes("tracks", -1, $rand, $lim); if ($rand === false) { sortElements($tlist, "number"); } $pl =& new jzPlaylist($tlist); $pl->play(); } } } exit; break; case "setplayback": // Stupid code. Should just use the id as the variable. // but if it ain't broke... $_SESSION['jb_playwhere'] = $_REQUEST['player']; // Now let's figure out it's ID for ($i = 0; $i < count($jbArr); $i++) { if ($jbArr[$i]['description'] == $_SESSION['jb_playwhere']) {
function standardPage(&$node) { global $jinzora_skin, $root_dir, $row_colors, $image_size, $desc_truncate, $image_dir, $jzSERVICES, $show_frontpage_items, $show_artist_alpha, $sort_by_year; // Let's setup the objects $blocks =& new jzBlocks(); $display =& new jzDisplay(); $fe =& new jzFrontend(); // Let's display the header $this->pageTop($node); // Now let's get the sub nodes to where we are if (isset($_GET['jz_letter'])) { $root = new jzMediaNode(); $nodes = $root->getAlphabetical($_GET['jz_letter'], "nodes", distanceTo("artist")); } else { if ($node->getLevel() == 0 && $show_frontpage_items == "false") { $nodes = array(); } else { $nodes = $node->getSubNodes("nodes"); } } // Now let's sort if ($sort_by_year == "true" and $node->getPType() == "artist") { sortElements($nodes, "year"); } else { sortElements($nodes, "name"); } echo '<form name="albumForm" method="POST" action="' . urlize() . '">'; echo '<input type="hidden" name="' . jz_encode('jz_list_type') . '" value="' . jz_encode('nodes') . '">'; // Now let's loop through the nodes $i = 0; foreach ($nodes as $item) { ?> <table width="100%" cellspacing="0" cellpadding="4"> <tr class="<?php $i = 1 - $i; echo $row_colors[$i]; ?> "> <td width="1%" valign="middle"> <input type="checkbox" name="jz_list[]" value="<?php echo jz_encode($item->getPath("String")); ?> "> </td> <td width="1%" valign="middle"> <?php $display->link($item, '<img src="' . $image_dir . 'folder.gif" border="0">'); ?> </td> <td width="96%" valign="middle"> <?php // Now let's link to this item $name = $item->getName(); if (!isNothing($item->getYear()) and $item->getPType() == "album") { $name .= " (" . $item->getYear() . ")"; } $display->link($item, $name); ?> </td> <td width="1%" valign="middle" nowrap align="right"> <?php // Now let's show the sub items if (($count = $item->getSubNodeCount("nodes")) != 0) { if ($count > 1) { $folder = word("folders"); } else { $folder = word("folder"); } $display->link($item, $count . " " . $folder); } else { if (($count = $item->getSubNodeCount("tracks")) != 0) { if ($count > 1) { $files = word("files"); } else { $files = word("file"); } $display->link($item, $count . " " . $files); } } ?> </td> <td width="1%" valign="middle" nowrap align="right"> <?php // Let's show a play button $display->playButton($item); echo " "; $display->randomPlayButton($item); ?> </td> </tr> <?php // Now do we hvae another row? if (($art = $item->getMainArt($image_size . "x" . $image_size)) != false or ($desc = $item->getDescription()) != "") { // Ok, we had stuff let's do a new row ?> <tr class="<?php echo $row_colors[$i]; ?> "> <td width="1%" valign="middle"> </td> <td width="99%" valign="middle" colspan="4"> <?php if ($art) { $display->link($item, $display->returnImage($art, $node->getName(), $image_size, $image_size, "limit", false, false, "left", "4", "4")); } echo $display->returnShortName($item->getDescription(), $desc_truncate); // Do we need the read more link? if (strlen($item->getDescription()) > $desc_truncate) { $url_array = array(); $url_array['jz_path'] = $item->getPath("String"); $url_array['action'] = "popup"; $url_array['ptype'] = "readmore"; echo ' <a href="' . urlize($url_array) . '" onclick="openPopup(this, 450, 450); return false;">...read more</a>'; } ?> </td> </tr> <?php } ?> </table> <table width="100%" cellspacing="0" cellpadding="0"><tr bgcolor="#D2D2D2"><td width="100%"></td></tr></table> <?php } // Now are there any tracks? if (isset($_GET['jz_letter'])) { $root = new jzMediaNode(); //$tracks = $root->getAlphabetical($_GET['jz_letter'],"tracks",-1); $tracks = array(); } else { $tracks = $node->getSubNodes("tracks"); } if (count($tracks) != 0) { $blocks->trackTable($tracks); } if (sizeof($nodes) > 0 || sizeof($tracks) > 0) { ?> <table width="100%" cellspacing="0" cellpadding="0"><tr height="2" style="background-image: url('<?php echo $image_dir; ?> row-spacer.gif');"><td width="100%"></td></tr></table> <table width="100%" cellspacing="0" cellpadding="3"> <tr class="and_head1"> <td width="100%"> <a style="cursor:hand" onClick="CheckBoxes('albumForm',true); return false;" href="javascript:;"><img src="<?php echo $image_dir; ?> check.gif" border="0"></a><a style="cursor:hand" onClick="CheckBoxes('albumForm',false); return false;" href="javascript:;"><img src="<?php echo $image_dir; ?> check-none.gif" border="0"></a> <?php $display->addListButton(); ?> <?php $display->hiddenVariableField('action', 'mediaAction'); ?> <?php $display->hiddenVariableField('path', $_GET['jz_path']); ?> <?php $url_array = array(); $url_array['action'] = "popup"; $url_array['ptype'] = "playlistedit"; echo '<a href="javascript:;" onClick="openPopup(' . "'" . urlize($url_array) . "'" . ',600,600); return false;"><img src="' . $image_dir . 'playlist.gif" border="0"></a>'; echo ' '; $display->playlistSelect(115, false, "all"); ?> </form> </td> </tr> </table> <?php } echo '</form>'; // Now let's close out $this->footer($node); }
function drawPage(&$node) { global $media_dir, $skin, $hierarchy, $album_name_truncate, $web_root, $root_dir, $jz_MenuItemLeft, $jz_MenuSplit, $jz_MenuItemHover, $jz_MainItemHover, $jz_MenuItem, $disable_random, $allow_download, $allow_send_email, $amg_search, $echocloud, $include_path, $enable_ratings, $truncate_artist_description, $sort_by_year, $cms_mode; $display =& new jzDisplay(); $blocks =& new jzBlocks(); $fe =& new jzFrontend(); // Let's see if the theme is set or not, and if not set it to the default //if (isset($_SESSION['cur_theme'])){ $_SESSION['cur_theme'] = $skin; } $nodes = $node->getSubNodes("nodes"); $tracks = $node->getSubNodes("tracks"); echo '<br>'; $blocks->blockBodyOpen(); // Now let's setup the big table to display everything ?> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="100%" valign="top" colspan="2"> <?php // Now let's include the menu system for the artist // First we'll need to setup some variables $play_all_artist = $display->link($node, false, false, false, true, true, false, true); $play_all_artist_rand = $display->link($node, false, false, false, true, true, true, true); $artist = $node->getName(); // Now let's inlucde the artist menu include_once $include_path . "frontend/menus/artist-menu.php"; ?> </td> </tr> <tr><td width="100%" valign="top" colspan="2" height="5"></td></tr> <tr> <td width="35%" valign="top"> <!-- Let's show the albums --> <?php // First let's sort this up if ($sort_by_year == "true") { sortElements($nodes, "year"); } else { sortElements($nodes, "name"); } foreach ($nodes as $child) { $display->playButton($child); $display->randomPlayButton($child); if ($enable_ratings == "true") { $display->rateButton($child); } echo '<input type="checkbox">'; echo ' '; $year = $child->getYear(); $dispYear = ""; if (!isNothing($year)) { $dispYear = " (" . $year . ")"; } $display->link($child, $display->returnShortName($child->getName(), $album_name_truncate) . $dispYear, $child->getName() . $dispYear); // ******************************* // Need to know how to return NEW information HERE // ******************************* echo "<br>"; } include_once $include_path . 'frontend/frontends/classic/general.php'; //displayArtistPLBar(); echo "<br>"; // Now let's show the art if (($art = $node->getMainArt('200x200')) !== false) { $display->image($art, $node->getName(), 200, 200, "limit", false, false, "left", "5", "5"); } // Now let's show the description if ($cms_mode == "false") { echo '<span class="jz_artistDesc">'; } $desc = $node->getDescription(); echo $display->returnShortName($desc, $truncate_artist_description); if (strlen($desc) > $truncate_artist_description) { $url_array = array(); $url_array['jz_path'] = $node->getPath("String"); $url_array['action'] = "popup"; $url_array['ptype'] = "readmore"; echo ' <a href="' . urlize($url_array) . '" onclick="openPopup(this, 450, 450); return false;">read more</a>'; } if ($cms_mode == "false") { echo '</span>'; } ?> </td> <td width="65%" valign="top"> <!-- Let's show the art --> <?php // Ok, now let's set our table for the art echo '<table width="100%" cellpadding="5" cellspacing="0" border="0">'; $c = 0; foreach ($nodes as $child) { $year = $child->getYear(); $dispYear = ""; if (!isNothing($year)) { $dispYear = " (" . $year . ")"; } // Now let's see if we should start a row if ($c == 0) { echo '</tr><tr>'; } // Now let's display the data echo '<td width="50%" align="center"><center>'; if (($art = $child->getMainArt('200x200')) !== false) { } else { // TODO: Create the default image here IF they want it $art = "style/images/default.jpg"; } $display->link($child, $display->returnShortName($child->getName(), $album_name_truncate) . $dispYear, $child->getName() . $dispYear, "jz_artist_album"); echo '<br>'; $display->link($child, $display->returnImage($art, $child->getName(), 200, false, "fit", false, false, false, false, false, "0", "jz_album_cover_picture"), $child->getName() . $dispYear); echo '<br><br></center></td>'; // Now let's increment so we'll know where to make the table $c++; if ($c == 2) { $c = 0; } } echo '</table>'; ?> </td> </tr> </table> <br> <?php $blocks->trackTable($tracks, false); $blocks->blockBodyClose(); echo '<br>'; }
global $img_folder; if (isset($_GET['jz_letter'])) { $root = new jzMediaNode(); $nodes = $root->getAlphabetical($_GET['jz_letter'], "nodes", distanceTo("artist")); } else { if ($node->getLevel() == 0 && $show_frontpage_items == "false") { $nodes = array(); } else { $nodes = $node->getSubNodes("nodes"); } } // Now let's sort if ($sort_by_year == "true" and $node->getPType() == "artist") { sortElements($nodes, "year"); } else { sortElements($nodes, "name"); } $smarty->assign('form_action', urlize()); $smarty->assign('hidden_field', '<input type="hidden" name="' . jz_encode('jz_list_type') . '" value="' . jz_encode('nodes') . '">'); // Now let's loop through the nodes $i = 0; $c = 0; foreach ($nodes as $item) { $array[$i]['name'] = $item->getName(); $array[$i]['path'] = $item->getPath('string'); $array[$i]['link'] = $display->link($item, $img_folder, false, false, true); $name = $item->getName(); if (!isNothing($item->getYear()) and $item->getPType() == "album") { $name .= " (" . $item->getYear() . ")"; } $array[$i]['name'] = $display->link($item, $name, false, false, true);
function nodeTable($nodes) { global $media_dir, $jinzora_skin, $hierarchy, $album_name_truncate, $row_colors, $img_more, $img_email, $img_rate, $img_discuss, $num_other_albums, $show_images, $sort_by_year, $show_descriptions, $item_truncate; if (sizeof($nodes) == 0) { return; } // Let's setup the new display object $display =& new jzDisplay(); $album = false; if ($nodes[0]->getPType() == "album") { $album = true; } if ($sort_by_year == "true" and $album) { sortElements($nodes, "year"); } else { sortElements($nodes, "name"); } if ($item_truncate == "") { $item_truncate = "25"; } // 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 ($nodes as $child) { $year = $child->getYear(); $dispYear = ""; if ($year != "-" and $year != "" and $album == true) { $dispYear = " (" . $year . ")"; } ?> <tr class="<?php echo $row_colors[$i]; ?> "> <td nowrap valign="top" colspan="2"> <?php $display->playButton($child, false, false); echo " "; $display->randomPlayButton($child, false, false); echo " "; $name = $display->returnShortName($child->getName(), $item_truncate); $display->link($child, $name); echo $dispYear; ?> </td> </tr> <?php // Let's see if we need the next row $art = $child->getMainArt("75x75"); $desc = $display->returnShortName($child->getDescription(), 200); if (($art != "" or $desc != "") and $show_images == "true") { ?> <tr class="<?php echo $row_colors[$i]; ?> " nowrap> <td valign="top"> <?php if ($show_images == "true" && ($art = $child->getMainArt("40x40")) !== false) { $display->link($child, $display->returnImage($art, $child->getName(), 40, 40, "limit", false, false)); } ?> </td> <td valign="top" > <?php if ($desc != "" and $show_descriptions == "true") { echo '<span class="jz_artistDesc">' . $desc . '</span>'; } ?> </td> </tr> <?php } ?> <?php $i = 1 - $i; // cool trick ;) } echo "</table>"; }
$mode = "POST"; } else { $mode = "GET"; } if (isset($_POST['jz_path'])) { $bcArray = explode("/", $_POST['jz_path']); } else { $bcArray = explode("/", $_GET['jz_path']); } // Now we need to cut the last item off the list $bcArray = array_slice($bcArray, 0, count($bcArray) - 1); $bread_crumbs = '<form action="' . $this_page . '" method="' . $mode . '">' . "\n"; $bread_crumbs .= '<select style="width:175px" class="jz_select" name="' . jz_encode('jz_path') . '" onChange="form.submit();">' . "\n"; $parent = $node->getParent(); $nodes = $parent->getSubNodes("nodes"); sortElements($nodes); foreach ($nodes as $child) { $path = $child->getPath("String"); $bread_crumbs .= '<option '; // Is this the current one? if ($child->getName() == $node->getName()) { $bread_crumbs .= ' selected '; } $bread_crumbs .= 'value="' . jz_encode($path) . '">' . $display->returnShortName($child->getName(), 20) . '</option>' . "\n"; } $bread_crumbs .= '</select>' . "\n"; //$display->hiddenVariableField("jz_path"); $bread_crumbs .= $display->hiddenPageVars(true); $bread_crumbs .= '<input type="hidden" name="frontend" value="' . $_GET['frontend'] . '">' . "\n"; $bread_crumbs .= "</form>"; $smarty->assign('bread_crumbs', $bread_crumbs);
function getCurNodeList() { global $sort_by_year, $node; $display =& new jzDisplay(); if (isset($_GET['jz_letter'])) { $root = new jzMediaNode(); $nodes = $root->getAlphabetical($_GET['jz_letter'], "nodes", distanceTo("artist")); } else { if (isset($_SESSION['JZ_CURRENT_MEDIA_LIST'])) { // Removed while coding //return $_SESSION['JZ_CURRENT_MEDIA_LIST']; } $nodes = $node->getSubNodes("nodes"); } if ($sort_by_year == "true") { sortElements($nodes, "year"); } else { sortElements($nodes, "name"); } $itemArray = array(); // Now let's loop through the nodes foreach ($nodes as $item) { $itemArray[] = array("name" => $item->getName(), "path" => $item->getPath(), "link" => $display->link($item, "VIEW", false, false, true), "playlink" => $display->playLink($item, "PLAY", false, false, true)); } $_SESSION['JZ_CURRENT_MEDIA_LIST'] = $itemArray; return $itemArray; }
function standardPage(&$node) { global $show_artist_alpha, $truncate_length, $sort_by_year; // Let's setup the objects $blocks =& new jzBlocks(); $display =& new jzDisplay(); // Let's display the header $this->pageTop($node); // ARTIST ALPHA: in header or only for root? Put the following in pageTop for the first... if ($node->getLevel() == 0 && $show_artist_alpha == "true") { $blocks->alphabeticalList($node, "artist", 0); } // Now let's get the sub nodes to where we are if (isset($_GET['jz_letter'])) { $root = new jzMediaNode(); $nodes = $root->getAlphabetical($_GET['jz_letter'], "nodes", distanceTo("artist")); } else { $nodes = $node->getSubNodes("nodes"); } if ($sort_by_year == "true") { sortElements($nodes, "year"); } else { sortElements($nodes, "name"); } // Now let's loop through the nodes foreach ($nodes as $item) { // Now let's link to this item $name = $item->getName(); if (strlen($name) > $truncate_length) { $name = substr($name, 0, $truncate_length) . ".."; } if (!isNothing($item->getYear()) and $item->getPType() == "album") { $name .= " (" . $item->getYear() . ")"; } // Let's show a play button echo " ("; $display->playLink($item, "P", word("Play"), false, false, false); echo "-"; $display->playLink($item, "R", word("Play Random"), false, false, true); echo ") "; $display->link($item, $name); echo "<br>"; } // Now are there any tracks? $tracks = $node->getSubNodes("tracks"); if (count($tracks) != 0) { $blocks->trackTable($tracks); } // Now let's close out $this->footer($node); }
function drawPage(&$node) { global $media_dir, $jinzora_skin, $hierarchy, $album_name_truncate, $row_colors, $jz_MenuItemLeft, $jz_MenuSplit, $jz_MenuItemHover, $jz_MainItemHover, $jz_MenuItem, $img_download, $img_more, $img_email, $img_play, $img_rate, $img_discuss, $num_other_albums, $include_path, $cms_mode; // Let's setup the new display object $display =& new jzDisplay(); $blocks =& new jzBlocks(); $fe =& new jzFrontend(); // Now let's display the header // Let's include the menus $album = $node->getName(); $artist = $node->getAncestor("artist"); if (is_object($artist)) { $artist = $artist->getName(); } else { $artist = ""; } echo '<br>'; $blocks->blockBodyOpen(); include_once $include_path . "frontend/menus/album-menu.php"; // Now let's setup the row with the description and the art for the album ?> <br> <table class="jz_track_table" width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="100%" valign="top"> <?php // Now let's get the art and description if (($art = $node->getMainArt()) !== false) { $display->playLink($node, $display->returnImage($art, $node->getName(), 200, 200, "fit", false, false, "left", "5", "5")); } ?> <?php // Now let's get some other random images if ($num_other_albums > 0) { $parent = $node->getAncestor("artist"); if (!is_object($parent)) { $parent = $node->getNaturalParent(); } $nodes = $parent->getSubNodes("nodes", false, true, $num_other_albums, true); // randomized, only with art. foreach ($nodes as $child) { if ($child->getName() != $node->getName()) { $year = $child->getYear(); if ($year != "-") { $dispYear = " (" . $year . ")"; } else { $dispYear = ""; } //echo " "; $display->link($child, $display->returnImage($child->getMainArt(), $child->getName(), 200, 200, "fit", false, false, "right", "5", "5"), $child->getName() . $dispYear); } } } if ($cms_mode == "false") { echo '<span class="jz_artistDesc">'; } echo $node->getDescription(); if ($cms_mode == "false") { echo '</span>'; } ?> </td> </tr> </table> <br> <?php // Now let's see if this is a multi-disc album $disks = $node->getSubNodes("nodes"); $all_tracks = array(); if (count($disks) > 0) { // Yep, it's a multi... foreach ($disks as $disk) { $disktracks = $disk->getSubNodes("tracks", -1); sortElements($disktracks, "number"); ob_start(); $display->playButton($disk); $display->link($disk, " <strong>" . $disk->getName() . "</strong><br>"); $header = ob_get_contents(); ob_end_clean(); // Now let's store the album name $all_tracks[] = $header; // Now let's display the tracks for this album foreach ($disktracks as $t) { $all_tracks[] = $t; } } } // Now let's read all the tracks for this album $tracks = $node->getSubNodes("tracks"); sortElements($tracks, "number"); $all_tracks += $tracks; $blocks->trackTable($all_tracks, "album"); $blocks->blockBodyClose(); }
/** * * Generates an XML list of all artists * * @author Ross Carlson * @since 3/31/05 * @return Returns a XML formatted list of all genres * **/ function listAllSubNode($type, $params) { global $this_site, $root_dir, $jzSERVICES; $limit = $params['limit']; // Let's setup the display object $display = new jzDisplay(); // Let's echo out the XML header echoXMLHeader(); // Let's get all the nodes $node = new jzMediaNode(); // Now let's get each genre $nodes = $node->getSubNodes("nodes", distanceTo($type), false, $limit); sortElements($nodes, "name"); foreach ($nodes as $item) { echo ' <' . $type . ' name="' . xmlUrlClean($item->getName()) . '">' . "\n"; echo ' <link>' . $this_site . xmlUrlClean($display->link($item, false, false, false, true, true)) . '</link>' . "\n"; // Now did they want full details? if (isset($_REQUEST['full']) && $_REQUEST['full'] == "true") { if (($art = $item->getMainArt(false, true, "audio", true)) !== false) { $image = xmlUrlClean($display->returnImage($art, false, false, false, "limit", false, false, false, false, false, "0", false, true)); } else { $image = ""; } echo ' <image>' . $image . '</image>' . "\n"; echo ' <desc><![CDATA[' . $item->getDescription() . ']]></desc>' . "\n"; } // Now let's close out echo " </" . $type . ">\n"; flushdisplay(); } echoXMLFooter(); }
/** * Seperates directories from files * @param array $elements * @return array */ function seperateDirectoriesAndFiles(&$elements) { $directories = array(); $files = array(); if (is_array($elements)) { foreach ($elements as $element) { if ($element['directory']) { $directories[] = $element; } else { $files[] = $element; } } } // Sort directories by their number of elements not their bytes if (sortKey() == 'bytes' && !empty($directories)) { $directories = sortElements($directories, array('key' => 'numberofelements', 'sort' => sortOrder())); } $elements = array('directories' => $directories, 'files' => $files); return true; }
echo '<table><tr><td>'; $arr['renumber_type'] = "mb"; echo '<a href="' . urlize($arr) . '">' . word("From Musicbrainz") . '</a>'; echo '</td></tr><tr><td>'; $arr['renumber_type'] = "fn"; echo '<a href="' . urlize($arr) . '">' . word("From filenames") . '</a>'; echo '</td></tr></table>'; } if ($_GET['renumber_type'] == "fn") { $albums = array(); if (sizeof($albums = $node->getSubNodes("nodes")) == 0) { $albums[] = $node; } foreach ($albums as $album) { $tracks = $album->getSubNodes("tracks"); sortElements($tracks, "filename"); for ($i = 0; $i < sizeof($tracks); $i++) { $meta = $tracks[$i]->getMeta(); $meta['number'] = $i + 1; $tracks[$i]->setMeta($meta); } } echo 'Done!'; echo '<br><br><center>'; $this->closeButton(true); exit; } else { if ($_GET['renumber_type'] == "mb") { $jzSERVICES->loadService("metadata", "musicbrainz"); // Did they submit the form? if (isset($_POST['edit_renumber'])) {