/** * Displays the block for the artist profile on the Artist page * * @author Ben Dodson, Ross Carlson * @since 9/13/05 * @version 9/13/05 * **/ function artistProfileBlock($node = false) { global $jzUSER, $album_name_truncate, $img_play, $img_random_play, $img_play_dis, $img_random_play_dis; $display = new jzDisplay(); // Does the cache file exist? if ($display->startCache("artistProfileBlock", $node)) { return; } $art = $node->getMainArt("150x150"); $desc_truncate = "700"; $desc = $display->returnShortName($node->getDescription(), $desc_truncate); if ($desc == "") { $profile .= "<center><br>"; if ($art !== false) { $profile .= $display->returnImage($art, $node->getName(), 150, 150, "limit"); } $profile .= "<br><br></center>"; } else { // Now let's show the art if ($art !== false) { $profile .= $display->returnImage($art, $node->getName(), 150, 150, "limit", false, false, "left", "5", "5"); } $desc = str_replace("\n", "<p>", $desc); $profile .= $desc; } if ($desc == "" and $art == false) { return; } if ($display->plaintextStrlen($node->getDescription()) > $desc_truncate) { $url_array = array(); $url_array['jz_path'] = $node->getPath("String"); $url_array['action'] = "popup"; $url_array['ptype'] = "readmore"; $profile .= ' <a href="' . urlize($url_array) . '" onclick="openPopup(this, 450, 450); return false;">read more</a>'; } if (!defined('NO_AJAX_LINKS') && $node === false) { $node = new jzMediaNode($_SESSION['jz_path']); } $nodes = $node->getSubNodes("nodes"); // Let's create our buttons for later if ($jzUSER->getSetting('stream')) { $playButtons = $display->playLink($node, $img_play, false, false, true) . " " . $display->playLink($node, $img_random_play, false, false, true, true) . " "; } else { $playButtons = $img_play_dis . $img_random_play_dis; } // Let's startup Smarty $smarty = smartySetup(); // Now let's assign our variables to smarty $smarty->assign('title', word("Artist") . ": " . $node->getName() . " "); $smarty->assign('rating', $display->rating($node, true)); $smarty->assign('playButtons', $playButtons); $smarty->assign('profile', $profile); // Now let's display the template $smarty->display(SMARTY_ROOT . 'templates/slick/artist-profile-block.tpl'); // Now lets finish out the cache $display->endCache(); }
/** * Displays the random playlist generator * * @author Ross Carlson, Ben Dodson * @version 2/20/05 * @since 2/20/05 */ function randomGenerateSelector($node, $header = false, $return = false) { global $this_page, $random_play_amounts, $quick_list_truncate, $default_random_type, $default_random_count, $jzUSER; $root = new jzMediaNode(); $display = new jzDisplay(); // Now, can they stream? if (!$jzUSER->getSetting('stream')) { return; } if ($return) { ob_start(); } if ($header) { echo $header; } else { echo '<font size="1">' . word("Randomize selected") . '</font><br>'; } ?> <form name="randomizer" action="<?php echo $this_page; ?> " method="post"> <input type="hidden" name="<?php echo jz_encode("action"); ?> " value="<?php echo jz_encode("generateRandom"); ?> "> <select name="<?php echo jz_encode("random_play_number"); ?> " class="jz_select"> <?php $random_play = explode("|", $random_play_amounts); $ctr = 0; while (count($random_play) > $ctr) { echo '<option value="' . jz_encode($random_play[$ctr]) . '"'; if ($random_play[$ctr] == $default_random_count) { echo " selected"; } echo '>' . $random_play[$ctr] . '</option>' . "\n"; $ctr = $ctr + 1; } echo '</select> '; echo '<select name="' . jz_encode("random_play_type") . '" class="jz_select" style="width:60px;">'; $random_play_types = "Songs|Albums|Artists"; $random_play = explode("|", $random_play_types); $ctr = 0; while (count($random_play) > $ctr) { // Let's make sure this isn't blank if ($random_play[$ctr] != "") { echo '<option value="' . jz_encode($random_play[$ctr]) . '"'; if ($random_play[$ctr] == $default_random_type) { echo " selected"; } echo '>' . $random_play[$ctr] . '</option>' . "\n"; } $ctr++; } echo '</select>'; // Now let's let them pick a genre if (distanceTo("genre") !== false) { $curgenre = getInformation($node, 'genre'); echo ' <select name="' . jz_encode("random_play_genre") . '" class="jz_select" style="width:75px;">'; if ($curgenre === false) { echo '<option value="' . jz_encode("") . '" selected>All Genres</option>' . "\n"; } else { echo '<option value="' . jz_encode("") . '">All Genres</option>' . "\n"; } if (!isset($genreArray)) { // todo: use the genre array from the other dropdown // so we don't query twice. $genreArray = $root->getSubNodes("nodes", distanceTo("genre")); } for ($ctr = 0; $ctr < count($genreArray); $ctr++) { if ($genreArray[$ctr] != "") { $title = returnItemShortName($genreArray[$ctr]->getName(), $quick_list_truncate); echo '<option '; // Now let's see if this is the genre we're looking at if (!isset($genre)) { $genre = ""; } if (strtolower($title) == strtolower($genre)) { echo 'selected'; } echo ' value="' . jz_encode(htmlentities($genreArray[$ctr]->getPath("String"))) . '"'; if ($curgenre == $genreArray[$ctr]->getName()) { echo ' selected'; } echo '>' . $title . '</option>' . "\n"; } } echo '</select>'; } echo ' <input class="jz_submit" type="submit" name="submit_random" value="' . word("Go") . '"'; if (!defined('NO_AJAX_JUKEBOX')) { echo ' onClick="return submitPlaybackForm(this,\'' . htmlentities($this_page) . '\')"'; } else { if (checkPlayback() == "embedded") { echo ' onClick="' . $display->embeddedFormHandler('randomizer') . '"'; } } echo '>'; echo '</form>'; echo '</nobr>'; if ($return) { $var = ob_get_contents(); ob_end_clean(); return $var; } }
function jzApi_nodes($argv) { global $display; $ret = array(); if (isset($argv["id"])) { $root = new jzMediaNode($argv["id"], "id"); } else { $root = new jzMediaNode(); } foreach ($root->getSubNodes("both") as $node) { if ($node instanceof jzMediaNode) { $ret[] = E($node->getName(), $node->getLevel() > 2 ? $node->getPlayHREF() : null, "nodes", array("id" => $node->getID())); } else { $ret[] = E($node->getName(), $node->getPlayHREF()); } } return $ret; }
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ $include_path = getcwd() . "/"; @(include_once 'system.php'); @(include_once 'settings.php'); include_once $include_path . "lib/general.lib.php"; include_once $include_path . 'services/class.php'; include_once 'backend/backend.php'; include_once 'frontend/display.php'; $jzSERVICES = new jzServices(); $jzSERVICES->loadStandardServices(); $display = new jzDisplay(); // Now let's get the node so we can get the tracks $node = new jzMediaNode($_GET['jz_path']); $par = $node->getAncestor("artist"); $artist = $par->getName(); $tracks = $node->getSubNodes("tracks", -1); // Now let's display the header header("Content-type: application/xml"); echo '<?xml version="1.0" encoding="utf-8"?>' . "\n" . '<rss xmlns:itunes="http://www.itunes.com/DTDs/Podcast-1.0.dtd" version = "2.0">' . "\n" . '<channel>' . "\n" . ' <atom:link rel="self" type="application/rss+xml" title="Jinzora - ' . str_replace("&", "&", $artist . " - " . $node->getName()) . '" href="' . $this_site . $_SERVER['REQUEST_URI'] . '" xmlns:atom="http://purl.org/atom/ns#" />' . "\n" . ' <title>Jinzora - ' . str_replace("&", "&", $artist . " - " . $node->getName()) . '</title>' . "\n" . ' <link>http://www.jinzora.com/</link>' . "\n" . ' <language>en-us</language>' . "\n" . ' <generator>Jinzora http://www.jinzora.com/</generator>' . "\n"; if (($art = $node->getMainArt("200x200")) != false) { echo ' <itunes:image rel="image" type="video/jpeg" href="' . str_replace("&", "&", $display->returnImage($art, false, false, false, "limit", false, false, false, false, false, "0", false, true)) . '">' . $node->getName() . '</itunes:image>' . "\n"; echo ' <itunes:link rel="image" type="video/jpeg" href="' . str_replace("&", "&", $display->returnImage($art, false, false, false, "limit", false, false, false, false, false, "0", false, true)) . '">' . $node->getName() . '</itunes:link>' . "\n"; } if (($desc = $node->getDescription()) != false) { echo ' <description><![CDATA[' . $desc . ']]></description>' . "\n"; } // Now let's loop through the tracks $i = 0; foreach ($tracks as $track) { // Let's get the tracks path $meta = $track->getMeta();
<nobr> <?php echo word('Album'); ?> : </nobr> </td> <td width="70%" valign="top"> <!-- <select name="edit_item_parent" class="jz_select" style="width:185px;"> <?php // Now let's get all the items at this level $root = new jzMediaNode(); switch ($node->getPType()) { case "artist": $valArr = $root->getSubNodes("nodes", distanceTo("genre")); break; } for ($e = 0; $e < count($valArr); $e++) { echo '<option '; if ($valArr[$e]->getName() == $parent->getName()) { echo ' selected '; } echo 'value="' . $valArr[$e]->getName() . '">' . $valArr[$e]->getName() . "</option>\n"; } ?> </select>--> <?php echo $album->getName(); ?> </td>
$list = $root->getSubNodes("tracks", -1); break; } if (isset($list)) { foreach ($list as $el) { echo $el->getName() . "\n"; } } break; case "search_metadata": if (isset($argv[2])) { $node = new jzMediaNode($argv[2]); } else { $node = new jzMediaNode(); } $nodes = $node->getSubNodes("nodes", -1); // Now let's add the node for what we are viewing $nodes = array_merge(array($node), $nodes); $total = count($nodes); $c = 0; $start = time(); foreach ($nodes as $item) { echo "Retrieving metadata for " . $item->getName() . ".\n"; // Now let's see if this is an artist if ($item->getPType() == 'artist') { // Now do we want to look at this? // Ok, let's get data for this artist // Now let's get the data IF we should if ($item->getMainArt() == "" or $item->getDescription() == "") { $arr = array(); $arr = $jzSERVICES->getArtistMetadata($item, true, "array");
/** * * 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(); }
function drawPage(&$node) { global $cellspacing, $this_page, $img_play, $artist_truncate, $main_table_width, $img_random_play, $directory_level, $web_root, $root_dir, $img_more, $media_dir, $show_sub_numbers, $show_all_checkboxes, $img_more_dis, $img_play_dis, $img_random_play_dis, $url_seperator, $days_for_new, $img_rate, $enable_ratings, $enable_discussion, $img_discuss, $show_sub_numbers, $disable_random, $info_level, $enable_playlist, $track_play_only, $css, $skin, $bg_c, $text_c, $img_discuss_dis, $hierarchy, $random_albums, $frontend, $include_path, $show_frontpage_items, $show_alphabet, $chart_types, $fe, $num_artist_cols, $show_artist_art, $art_size, $artist_art_size; // 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; } // if you were looking this, sorry for the hack ;) // Override icons and other styles: handleFrontendOverrides(); // Let's setup the display object $blocks =& new jzBlocks(); $display =& new jzDisplay(); $fe =& new jzFrontend(); ?> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> <td align="center" valign="top"> <?php // Now let's display the site description /*$news = $blocks->siteNews($node); if ($news <> ""){ ?> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td class="jz_block_td" colspan="3"> <strong><?php echo word("Site News"); ?></strong> </td> </tr> <tr> <td class="jz_nj_block_body" width="33%"> <?php echo $news; ?> </td> </tr> </table> <br> <?php }*/ $lvl = isset($_GET['jz_letter']) ? $_GET['jz_level'] + $node->getLevel() - 1 : $node->getLevel(); $show_art = false; switch ($hierarchy[$lvl]) { case "genre": $pg_title = word("ALL GENRES"); break; case "artist": $pg_title = word("ALL ARTISTS"); if ($show_artist_art == "true") { $show_art = true; $my_art_size = $artist_art_size; } break; case "album": $pg_title = word("ALL ALBUMS"); if ($show_album_art == "true") { $show_art = true; $my_art_size = $art_size; } break; default: $pg_title = word("ALL GENRES"); break; } ?> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <?php if (isset($_GET['jz_charts'])) { $node = new jzMediaNode(); chartHelper("newalbums"); chartHelper("recentplayalbum"); echo '</tr>'; echo '<tr><td colspan="2">'; include jzBlock('randomAlbums'); echo '</td></tr>'; return; } echo '<td class="jz_block_td" colspan="3">'; if (isset($_GET['jz_letter'])) { $genres = $node->getAlphabetical($_GET['jz_letter'], "nodes", $_GET['jz_level']); } else { $genres = $node->getSubNodes("nodes"); } // Now for the title if ($_GET['jz_path'] == "") { echo '<strong>' . $pg_title . "</strong>"; } else { echo '<strong>ARTISTS IN '; $display->link($node, $node->getName()); echo ' (' . $node->getSubNodeCount("nodes") . ")</strong>"; } ?> </td> </tr> <?php $colwidth = floor(100 / $num_artist_cols); $c = 0; foreach ($genres as $genre) { // Now let's start our row if ($c % $num_artist_cols == 0) { if ($c > 0) { echo '</tr>'; } echo '<tr>'; } echo '<td class="jz_nj_block_body" width="' . $colwidth . '%" valign="top">'; $display->playButton($genre); echo " "; $linktext = $display->returnShortName($genre->getName(), 25); if ($show_art) { if ($art = $genre->getMainArt($my_art_size . 'x' . $my_art_size)) { $linktext .= '<br/>'; $linktext .= $display->returnImage($art); } } $display->link($genre, $linktext, word("Browse: ") . $genre->getName()); //echo " (". $genre->getSubNodeCount("both"). ")"; echo '</td>'; $c++; } // Now let's finish out while ($c % $num_artist_cols != 0) { echo '<td class="jz_nj_block_body"> </td>'; $c++; } ?> </tr> </table> </td> <td align="center"> </td> <?php // Now what to show? if ($_GET['jz_path'] != "") { /* ?> <td align="center" valign="top"> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td class="jz_block_td" colspan="3"> <strong>ALBUMS IN THIS GENRE [<?php $display->link($node,$node->getName()); ?>] (<?php echo $node->getSubNodeCount("nodes",2); ?>)</strong> </td> </tr> <?php $albums = $node->getSubNodes("nodes",distanceTo("album",$node)); $c=0; foreach($albums as $album){ // Now let's start our row if ($c == 0){echo '<tr>';} echo '<td class="jz_nj_block_body" nowrap width="33%">'; $display->playButton($album); echo " "; $display->randomPlayButton($album); echo " "; $display->link($album, $display->returnShortName($album->getName(),15), word("Browse: "). $album->getName()); echo " (". $album->getSubNodeCount("tracks"). ")"; echo '</td>'; $c++; if ($c==3){$c=0;} } // Now let's finish out if ($c <> 0){ while($c<3){ echo '<td class="jz_nj_block_body"> </td>'; $c++; } } ?> </table> </td> <?php */ } else { /* ?> <td align="center" valign="top"> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td class="jz_block_td"> <strong>LATEST ARTISTS</strong> </td> </tr> <tr> <td class="jz_nj_block_body"> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <?php // Now how many should we show? $show = round(((count($genres) / 3)) * 1.5); $blocks->showCharts($node,"newartists",$show,false,false); ?> </table> </td> </tr> </table> </td> <td align="center"> </td> <td align="center" valign="top"> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td class="jz_block_td"> <strong>LATEST ALBUMS</strong> </td> </tr> <tr> <td class="jz_nj_block_body"> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <?php $show = round(((count($genres) / 3)) * 1.5); $blocks->showCharts($node,"newalbums",$show,false,false); ?> </table> </td> </tr> </table> </td> <?php */ } ?> </tr> </table> <br> <?php }
// Now let's see if they searched if (isset($_POST['searchDupArtists']) or isset($_POST['searchDupAlbums']) or isset($_POST['searchDupTracks'])) { // Ok, let's search, but for what? if (isset($_POST['searchDupArtists'])) { $distance = distanceTo("artist"); $what = "nodes"; } if (isset($_POST['searchDupAlbums'])) { $distance = distanceTo("album"); $what = "nodes"; } // Ok, now we need to get a list of ALL artist so we can show possible dupes echo word("Retrieving full list...") . "<br><br>"; flushdisplay(); $root = new jzMediaNode(); $artArray = $root->getSubNodes($what, $distance); for ($i = 0; $i < count($artArray); $i++) { $valArray[] = $artArray[$i]->getName(); } echo word("Scanning full list...") . "<br><br>"; flushdisplay(); $found = $root->search($valArray, $what, $distance, sizeof($valArray), "exact"); foreach ($found as $e) { $matches[] = $e->getName(); echo $e->getName() . '<br>'; flushdisplay(); } $this->closeBlock(); exit; } $arr = array();