$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(); $artist = $track->getAncestor("artist"); // Now let's create the URL $tpArr = explode("?", $track->getFileName("user")); $path = $this_site . $root_dir . "/mediabroadcast.php/" . $tpArr[1] . "/" . $track->getName() . ".mp3"; $path = str_replace("&", "&", $path); $tName = $track->getName(); if ($meta['number'] != "") { $tName = $meta['number'] . " - " . $tName;
/** * Displays the block for the album on the Album page * * @author Ben Dodson, Ross Carlson * @since 9/6/05 * @version 9/6/05 * **/ function albumAlbumBlock($node = false) { global $album_name_truncate, $img_play, $cms_mode, $img_random_play, $img_play_dis, $img_random_play_dis, $jzUSER, $short_date, $enable_ratings, $show_album_clip_play, $img_clip; $display = new jzDisplay(); // Does the cache file exist? if ($display->startCache("albumAlbumBlock", $node)) { return; } if (!defined('NO_AJAX_LINKS') && $node === false) { $node = new jzMediaNode($_SESSION['jz_path']); } $artSize = 100; $desc_truncate = 700; $desc = $node->getDescription(); // Now let's purge the extra returns that might be at the beginning while (substr($desc, 0, 4) == "<br>" or substr($desc, 0, 6) == "<br />") { if (substr($desc, 0, 4) == "<br>") { $desc = substr($desc, 5); } if (substr($desc, 0, 6) == "<br />") { $desc = substr($desc, 7); } } if ($desc == "") { $artSize = 200; } $art = $node->getMainArt($artSize . "x" . $artSize); if ($art == false and $desc == "") { return; } // 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 .= " "; // Let's open the block $this->blockHeader(word("Album") . ": " . $title . $dispYear . " ", $playButtons); $this->blockBodyOpen(); ?> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td width="100%" <?php if ($desc == "") { echo 'align="center"'; $align = ""; } else { $align = "left"; } ?> > <?php // If there is no description let's make the art bigger $rating = $display->rating($node, true); if ($rating != "" and $desc == "") { echo $rating . "<br>"; } if ($jzUSER->getSetting('stream')) { $display->playLink($node, $display->returnImage($art, $node->getName(), $artSize, $artSize, "fit", false, false, $align, "5", "5")); } else { $display->Image($art, $node->getName(), $artSize, $artSize, "fit", false, false, $align, "5", "5"); } if ($cms_mode == "false") { echo '<span class="jz_artistDesc">'; } if ($rating != "" and $desc != "") { echo $rating . "<br>"; } $desc = str_replace("\n", '<p>', $desc); echo $display->returnShortName($desc, $desc_truncate); if (strlen($desc) > $desc_truncate) { $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 (!isNothing($node->getDateAdded()) && $node->getDateAdded() != "0") { echo "<br>" . word("Added") . ": " . date($short_date, $node->getDateAdded()); } if ($cms_mode == "false") { echo '</span>'; } ?> </td> </tr> </table> <?php // let's close the block $this->blockBodyClose(); $this->blockSpacer(); // Now lets finish out the cache $display->endCache(); }
/** * Returns the AJAX code for the Whow is where block * * @author Ross Carlson * @since 8.21.05 * **/ function returnWhoisWhere() { global $jzUSER, $img_tiny_play, $img_tiny_play_dis, $user_tracking_age, $css, $include_path, $root_dir, $who_is_where_height, $jzSERVICES; $define_only = true; writeLogData("messages", "WIWB: starting up"); $display = new jzDisplay(); $be = new jzBackend(); // let's get the history $oldHist = $be->loadData('history'); $dArr = explode("\n", $oldHist); $retVal = ""; $count = 1; $home = 0; $ipList = ""; for ($i = 0; $i < count($dArr); $i++) { $vArr = explode("|", $dArr[$i]); // Now let's make sure this isn't the current user and that it's not too old if (isset($vArr[3])) { $ago = $vArr[3] + $user_tracking_age * 60; if (($vArr[4] != $jzUSER->getName() or $vArr[4] == "Anonymous") and $vArr[6] != $_SESSION['sid'] and $ago - time() > 0 and !stristr($ipList, "|" . $vArr[7])) { $time = round((time() - $vArr[3]) / 60); if ($time < 1) { $time = 1; } $ipList .= "|" . $vArr[7]; // Now let's count $count++; writeLogData("messages", "WIWB: Ago: " . $time); // Let's setup the object from the path $item = new jzMediaNode($vArr[2]); // Let's setup our links $arr = array(); $arr['jz_path'] = $vArr[2]; if ($vArr[1] == "") { $vArr[1] = "Home"; $home++; } $item = new jzMediaNode($arr['jz_path']); $art = $item->getMainArt("75x75"); if ($art) { $albumImage = str_replace('"', '', $display->returnImage($art, "", 75, 75, "limit", false, false, "left", "3", "3")); } else { $albumImage = ""; } $desc_truncate = 200; $desc = htmlentities(str_replace("'", "", str_replace("'", "", $item->getDescription()))); $userName = $vArr[4]; if ($userName == "") { $userName = "******"; } if ($vArr[5] != "") { $userName = $vArr[5]; } $body = "<strong>" . word("Viewing: ") . $userName . "</strong><br>" . word("Last seen") . ": " . $time . " " . word("minutes ago") . "<br>" . $albumImage . $display->returnShortName($desc, $desc_truncate); $title = str_replace("'", "", $vArr[1]); // Let's display if ($vArr[1] != "Home") { if ($jzUSER->getSetting('stream')) { $retVal .= ' <a href="' . urlize($arr) . '"'; if (checkPlayback() == "embedded") { //$jzSERVICES = new jzServices(); $jzSERVICES->loadService("players", $jzUSER->getSetting("player")); $retVal .= ' ' . $jzSERVICES->returnPlayerHref(); } $retVal .= '>' . $img_tiny_play . '</a> <a target="_parent" ' . $display->returnToolTip($body, $title) . ' href="' . str_replace("ajax_request", "index", urlize($arr)) . '">' . $display->returnShortName($vArr[1], 15) . '</a><br>'; } else { $retVal .= ' ' . $img_tiny_play_dis . ' <a target="_parent" ' . $display->returnToolTip($body, $title) . ' href="' . str_replace("ajax_request", "index", urlize($arr)) . '">' . $display->returnShortName($vArr[1], 15) . '</a><br>'; } } } } } if ($count == 1 or $count == 0) { $tCtr = ""; } else { $tCtr = " (" . ($count - 1) . ")"; } $return = "<strong>" . word("Who is Where") . $tCtr . "</strong><br />"; if ($home > 0) { $arr = array(); $arr['jz_path'] = ""; $return .= '<a href="' . str_replace("ajax_request", "index", urlize($arr)) . '">Home (' . $home . ")</a><br>"; } $maxHeight = $who_is_where_height * 13 + 26; $style = ""; if ($maxHeight < $count * 13 + 26) { $style = "<style>#whoiswhere{height: " . $maxHeight . "px;overflow:auto;}</style>"; } $return .= $style . $retVal; writeLogData("messages", "WIWB: displaying data"); echo $return; exit; }