function drawPage($node) { global $random_albums, $include_path; $display = new jzDisplay(); $blocks = new jzBlocks(); echo '<br>'; $blocks->blockBodyOpen(); if (isset($_GET['letter'])) { $nodes = $node->getAlphabetical($_GET['letter'], 'nodes', 2); } else { $nodes = $node->getSubNodes('nodes'); } $tracks = $node->getSubNodes('tracks'); // Now let's display the site description $news = $blocks->siteNews($node); if ($news != "") { echo "<br><center>" . $news . "<center>"; } $cols = 4; $curCol = 1; $per_col = round(sizeof($nodes) / $cols); $i = 0; $percent = round(100 / $cols); echo "<table cellpadding=\"4\" width=\"100%\"><tr class=\"jz_col_table_tr\"><td class=\"jz_col_table\" valign=\"top\" width=\"{$percent}%\"><table>"; foreach ($nodes as $el) { if ($i == $per_col && $curCol != $cols) { $curCol++; echo "</table></td><td class=\"jz_col_table\" valign=\"top\" width=\"{$percent}%\"><table width=\"100%\">"; $i = 0; } echo "<tr><td>"; $display->link($el); echo "</td></tr>"; $i++; } echo "</table></td></tr></table>"; if (!isset($_GET['letter'])) { $url = array(); $url['letter'] = '#'; echo "| <a href=\"" . urlize($url) . "\">#</a>"; for ($let = 'A'; $let != 'Z'; $let++) { $url['letter'] = $let; echo " | <a href=\"" . urlize($url) . "\">" . $let . "</a>"; } $url['letter'] = "*"; echo " | <a href=\"" . urlize($url) . "\">ALL</a> |"; echo "<br>"; if (sizeof($tracks) > 0) { $blocks->trackTable($tracks, false, true); } if ($random_albums != "0") { echo "<br>"; $blocks->randomAlbums($node, $node->getName()); } } $blocks->blockBodyClose(); echo "<br>"; }
function drawPage($node) { global $random_albums, $include_path; $display = new jzDisplay(); $blocks = new jzBlocks(); $nodes = $node->getSubNodes('nodes'); $tracks = $node->getSubNodes('tracks'); // Now let's display the site description $news = $blocks->siteNews($node); if ($news != "") { echo "<br><center>" . $news . "<center>"; } $cols = 4; $curCol = 1; $per_col = round(sizeof($nodes) / $cols); $i = 0; $percent = round(100 / $cols); echo "<table cellpadding=\"4\" width=\"100%\"><tr class=\"jz_col_table_tr\"><td class=\"jz_col_table\" valign=\"top\" width=\"{$percent}%\"><table width=\"100%\"><tr><td>"; foreach ($nodes as $el) { if ($i == $per_col && $curCol != $cols) { $curCol++; echo "</td></tr></table></td><td class=\"jz_col_table\" valign=\"top\" width=\"{$percent}%\"><table width=\"100%\"><tr><td>"; $i = 0; } $display->link($el); echo "</td></tr><tr><td>"; $i++; } echo "</td></tr></table></td></tr></table>"; echo "<br>"; echo "<br>"; if (sizeof($tracks) > 0) { $blocks->trackTable($tracks, false, true); } if ($random_albums != "0") { include_once $include_path . "frontend/blocks/random-albums.php"; echo "<br>"; $blocks->randomAlbums(&$node, $node->getName()); echo "<br>"; } }
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; }
<?php global $this_page; $artArray = $node->getSubNodes("nodes", distanceTo("album", $node), false, -1, true); if (count($artArray) == 0) { return; } $display = new jzDisplay(); $smarty = smartySetup(); // Let's setup our page links $link = "Page: "; $link .= '<form action="' . $this_page . '" method="POST">' . "\n"; $link .= '<input type="hidden" name="' . jz_encode("action") . '" value="' . jz_encode("viewallart") . '">'; $link .= '<input type="hidden" name="' . jz_encode("jz_path") . '" value="' . jz_encode($node->getPath("String")) . '">'; $link .= '<select name="' . jz_encode("page") . '" class="jz_select" onChange="form.submit();">' . "\n"; $link .= '<option '; $_POST['page'] = isset($_POST['page']) ? $_POST['page'] : ''; if ($_POST['page'] == "RANDOM") { $link .= " selected "; } $link .= 'value="' . jz_encode("RANDOM") . '">' . word("Random") . '</option>' . "\n"; $link .= '<option '; if ($_POST['page'] == "ALL") { $link .= " selected "; } $link .= 'value="' . jz_encode("ALL") . '">' . word("All") . '</option>' . "\n"; $link .= '<option '; if ($_POST['page'] + 1 == 1 and $_POST['page'] != "ALL") { $link .= " selected "; } $link .= 'value="' . jz_encode("0") . '">1</option>' . "\n";
<?php global $random_art_size; $display = new jzDisplay(); $sm = smartySetup(); if (!isset($node) || $random_albums <= 0) { return; } $art = array(); $artArray = $node->getSubNodes("nodes", distanceTo("album", $node), true, $random_albums, true); foreach ($artArray as $al) { $art[] = array('name' => $al->getName(), 'link' => urlize(array('jz_path' => $al->getPath("string"))), 'playlink' => $display->playlink($al, 'Play', false, false, true), 'art' => $display->returnImage($al->getMainArt($random_art_size . 'x' . $random_art_size), $al->getName(), $random_art_size, $random_art_size, "fixed")); } $sm->assign('albums', $art); jzTemplate($sm, 'randomAlbums');
/** * 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'); }
/** * Adds meta data to all subnodes * * @author Ben Dodson * @version 1/21/05 * @since 1/21/05 * **/ function bulkMetaUpdate($meta, $mode = false, $displayOutput = false) { $tracks = $this->getSubNodes("tracks", -1); foreach ($tracks as $track) { $track->setMeta($meta, $mode, $displayOutput); } $display = new jzDisplay(); $display->purgeCachedPage($this); }
fclose($handle); // now let's close out $this->closeWindow(true); exit; } $i++; } // Let's resize ?> <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"><!--\ window.resizeTo(500,700) --> </SCRIPT> <?php flushdisplay(); $display = new jzDisplay(); $this->displayPageTop("", "Searching for art for: " . $node->getName()); $this->openBlock(); echo word('Searching, please wait...') . "<br><br>"; flushdisplay(); // Now let's display what we got $i = 0; echo "<center>"; // Let's setup our form $arr = array(); $arr['action'] = "popup"; $arr['ptype'] = "getalbumart"; $arr['jz_path'] = $node->getPath('String'); echo '<form action="' . urlize($arr) . '" method="POST">'; $i = 0; // Ok, now let's setup a service to get the art for each of the providers
/** * Draws the play controller for the Jukezora interface * * @author Ross Carlson * @version 01/21/05 * @since 01/21/05 */ function jukeboxBlock() { global $this_page, $media_dirs, $jbArr, $root_dir, $include_path; $display = new jzDisplay(); include_once $include_path . "jukebox/class.php"; if (!isset($_SESSION['jb_playwhere'])) { $_SESSION['jb_playwhere'] = "stream"; } $jb_playwhere = $_SESSION['jb_playwhere']; ?> <table width="100%" cellpadding="2" cellspacing="0" border="0" class="jz_block_td" height="100%"> <tr> <td width="50%" valign="top" height="100%"> <nobr> <?php // Now let's create our Jukebox class and connect to it to make sure it works $jb = new jzJukebox(); if (!$jb->connect()) { echo "We had a problem connecting to the player, sorry this is a fatal error!<br><br>"; echo "Player Settings:<br>"; for ($i = 0; $i < count($jbArr); $i++) { if ($jbArr[$i]['description'] == $_SESSION['jb_playwhere']) { foreach ($jbArr[$i] as $setting => $value) { echo $setting . " - " . $value . "<br>"; } } } echo "<br>Please check these with your player's settings"; echo "<br>"; ?> Playback to:<br> <?php $arr = array(); $arr['action'] = "jukebox"; $arr['subaction'] = "jukebox-command"; $arr['command'] = "playwhere"; ?> <form action="<?php echo urlize($arr); ?> " method="post"> <select name="jbplaywhere" class="jz_select" style="width:142;" onChange="submit()"> <option <?php if ($jb_playwhere == "stream") { echo " selected "; } ?> value="stream">Stream</option> <?php // Now let's get a list of all the jukeboxes that are installed for ($i = 0; $i < count($jbArr); $i++) { echo '<option '; if ($jb_playwhere == $jbArr[$i]['description']) { echo " selected "; } echo 'value="' . $jbArr[$i]['description'] . '">' . $jbArr[$i]['description'] . '</option>'; } ?> </select> </form> <?php return; } // Let's figure out where they are playing if (isset($_SESSION['jb_playwhere'])) { $jb_playwhere = $_SESSION['jb_playwhere']; } else { $jb_playwhere = ""; } $remain = $jb->getCurrentTrackRemaining() + 1; $jz_jbstatus = $jb->getPlayerStatus(); if ($jz_jbstatus != "playing") { $remain = 0; } if ($remain == 1) { $remain = 0; } if ($jb_playwhere != "stream") { // Ok, now we need to make sure we can do things $func = $jb->jbAbilities(); if ($func['playbutton']) { $display->displayJukeboxButton("play"); } if ($func['pausebutton']) { $display->displayJukeboxButton("pause"); } if ($func['stopbutton']) { $display->displayJukeboxButton("stop"); } if ($func['shufflebutton']) { $display->displayJukeboxButton("random_play"); } echo "<br>"; if ($func['nextbutton']) { $display->displayJukeboxButton("previous"); } if ($func['prevbutton']) { $display->displayJukeboxButton("next"); } if ($func['clearbutton']) { $display->displayJukeboxButton("clear"); } ?> <br> <?php if ($func['status']) { ?> Status: <?php echo ucwords($jz_jbstatus); ?> <br> <?php } ?> <?php if ($func['stats']) { $jb->returnJBStats(); echo '<br>'; } ?> <?php if ($func['progress']) { ?> Progress: <span id="timer"></span> <script> <!--// var loadedcolor='green' ; // PROGRESS BAR COLOR var unloadedcolor='lightgrey'; // BGCOLOR OF UNLOADED AREA var barheight=10; // HEIGHT OF PROGRESS BAR IN PIXELS var barwidth=120; // WIDTH OF THE BAR IN PIXELS var bordercolor='black'; // COLOR OF THE BORDER var waitTime=<?php echo $remain; ?> ; // NUMBER OF SECONDS FOR PROGRESSBAR --> </script> <script language="javascript" src="<?php echo $root_dir; ?> /jukebox/pbar.js"></script> <?php if ($jz_jbstatus == 'playing') { ?> <script> <!--// var seconds = <?php echo $jb->getCurrentTrackLocation(); ?> ; var time = ''; t = document.getElementById("timer"); function converTime(sec){ ctr=0; while (sec >= 60){ sec = sec - 60; ctr++; } if (ctr<0){ctr=0} if (sec<0){sec=0} if (sec < 10){ sec = "0" + sec; } return ctr + ":" + sec; } function display(){ seconds++ t.innerHTML = converTime(seconds) + "/" + "<?php echo convertSecMins($jb->getCurrentTrackLength()); ?> "; ctr=0; setTimeout("display()",1000) } display() --> </script> <?php } ?> <?php } ?> <?php if ($func['volume']) { ?> <?php $arr = array(); $arr['action'] = "jukebox"; $arr['subaction'] = "jukebox-command"; $arr['command'] = "volume"; $arr['frame'] = $_GET['frame']; ?> <form action="<?php echo urlize($arr); ?> " method="post"> <input type="hidden" name="action" value="jukebox"> <input type="hidden" name="subaction" value="jukebox-command"> <input type="hidden" name="command" value="volume"> <input type="hidden" name="frame" value="top"> <select name="jbvol" class="jz_select" style="width:120px;" onChange="submit()"> <?php $vol = ""; if (isset($_SESSION['jz_jbvol-' . $_SESSION['jb_id']])) { $vol = $_SESSION['jz_jbvol-' . $_SESSION['jb_id']]; } $c = 100; while ($c > 0) { echo '<option '; if ($c == $vol) { echo ' selected '; } echo 'value="' . $c . '">Volume ' . $c . '%</option>'; $c = $c - 10; } ?> <option value="0">Mute</option> </select> </form> <br> <?php } ?> <?php // This closes our if to see if we are streaming or not } ?> Playback to:<br> <?php $arr = array(); $arr['action'] = "jukebox"; $arr['subaction'] = "jukebox-command"; $arr['command'] = "playwhere"; $arr['frame'] = $_GET['frame']; ?> <form action="<?php echo urlize($arr); ?> " method="post"> <input type="hidden" name="action" value="jukebox"> <input type="hidden" name="subaction" value="jukebox-command"> <input type="hidden" name="command" value="playwhere"> <input type="hidden" name="frame" value="top"> <select name="jbplaywhere" class="jz_select" style="width:120px;" onChange="submit()"> <option <?php if ($jb_playwhere == "stream") { echo " selected "; } ?> value="stream">Stream</option> <?php // Now let's get a list of all the jukeboxes that are installed for ($i = 0; $i < count($jbArr); $i++) { echo '<option '; if ($jb_playwhere == $jbArr[$i]['description']) { echo " selected "; } echo 'value="' . $jbArr[$i]['description'] . '">' . $jbArr[$i]['description'] . '</option>'; } ?> </select> </form> <?php if ($jb_playwhere != "stream" and $func['addtype']) { ?> <br> Add type:<br> <?php // Now let's set the add type IF it hasn't been set if (!isset($_SESSION['jb-addtype'])) { $_SESSION['jb-addtype'] = "current"; } ?> <?php $arr = array(); $arr['action'] = "jukebox"; $arr['subaction'] = "jukebox-command"; $arr['command'] = "addwhere"; $arr['frame'] = $_GET['frame']; ?> <form action="<?php echo urlize($arr); ?> " method="post"> <input type="hidden" name="action" value="jukebox"> <input type="hidden" name="subaction" value="jukebox-command"> <input type="hidden" name="command" value="addwhere"> <select name="addplat" class="jz_select" style="width:142;" onChange="submit()"> <option <?php if ($_SESSION['jb-addtype'] == "current") { echo " selected "; } ?> value="current">At Current</option> <option <?php if ($_SESSION['jb-addtype'] == "end") { echo " selected "; } ?> value="end">At End</option> <option <?php if ($_SESSION['jb-addtype'] == "begin") { echo " selected "; } ?> value="begin">At Beginning</option> <option <?php if ($_SESSION['jb-addtype'] == "replace") { echo " selected "; } ?> value="replace">Replace</option> </select> </form> </nobr> <?php } ?> </td> <td width="50%" valign="top"> <?php // Let's make sure they aren't streaming if ($jb_playwhere == "stream") { return; } ?> <?php if ($func['nowplaying']) { ?> <nobr><?php echo word("Now Playing:"); ?> <br> <?php $curTrack = $jb->getCurrentTrackName(); if (strlen($curTrack) > 20) { $curTrack = substr($curTrack, 0, 20) . "..."; } echo ' ' . $curTrack . "</nobr>"; ?> <br> <?php } ?> <?php if ($func['nexttrack']) { ?> <nobr><?php echo word("Next Track:"); ?> <br> <?php // Now let's figure out the next track and clean it up $fullList = $jb->getCurrentPlaylist(); if (getCurPlayingTrack() + 1 < sizeof($fullList)) { $nextTrack = $fullList[getCurPlayingTrack() + 1]; } else { $nextTrack = '-'; } if (stristr($nextTrack, "/")) { $nArr = explode("/", $nextTrack); $nextTrack = $nArr[count($nArr) - 1]; } $nextTrack = str_replace(".mp3", "", $nextTrack); if (strlen($nextTrack) > 20) { $nextTrack = substr($nextTrack, 0, 20) . "..."; } echo ' ' . $nextTrack . "</nobr>"; ?> <br><br> <?php } ?> <?php if ($func['fullplaylist']) { ?> Complete Playlist <br> <?php // Now let's get the full playlist back $curTrackNum = $jb->getCurrentPlayingTrack(); ?> <?php $arr = array(); $arr['action'] = "jukebox"; $arr['subaction'] = "jukebox-command"; $arr['command'] = "jumpto"; ?> <form action="<?php echo urlize($arr); ?> " method="post"> <input type="hidden" name="action" value="jukebox"> <input type="hidden" name="subaction" value="jukebox-command"> <input type="hidden" name="command" value="jumpto"> <input type="hidden" name="frame" value="top"> <select name="jbjumpto" class="jz_select" size="5" style="width:165px;"<?php if ($func['jump']) { echo 'onChange="submit()"'; } ?> > <?php for ($i = 0; $i < count($fullList); $i++) { echo '<option value="' . $i . '"'; if ($curTrackNum == $i) { echo " selected "; } echo '>' . $fullList[$i] . '</option>'; } ?> </select> </form> <?php } ?> </td> </tr> </table> <?php }
<?php if (!defined(JZ_SECURE_ACCESS)) { die('Security breach detected.'); } global $jukebox; // Let's setup our objects $display = new jzDisplay(); $blocks = new jzBlocks(); $smarty = smartySetup(); if (!is_object($node)) { $node = new jzMediaNode(); } // Let's include the settings file include_once $include_path . 'frontend/frontends/andro/settings.php'; // TO DO - SMARTY!!! $display->preHeader(); $smarty->assign('this_page', $this_page); $smarty->assign('img_home', $img_home); $smarty->assign('cms_mode', $cms_mode); $smarty->assign('image_dir', $image_dir); $smarty->assign('jinzora_url', $jinzora_url); $smarty->assign('word_search', word('Search:')); $smarty->assign('word_all_media', word('All Media')); if ($cms_mode == "true") { $smarty->assign('method', "GET"); } else { $smarty->assign('method', "POST"); } if ($jukebox == "true" && !defined('NO_AJAX_JUKEBOX')) { $smarty->assign('searchOnSubmit', 'onSubmit="return searchKeywords(this,\'' . htmlentities($this_page) . '\');"');
<?php if (!defined(JZ_SECURE_ACCESS)) { die('Security breach detected.'); } /** * Displays the track details for the currently playing track in WMP * * @author Ross Carlson * @since 8.3.06 * @version 8.3.06 **/ global $this_site, $root_dir, $jzSERVICES, $web_root; // Let's setup our display object $display = new jzDisplay(); // Let's create the track object $track = new jzMediaTrack($_GET['jz_path']); $meta = $track->getMeta(); // Now let's get the album and artist $album = $track->getNaturalParent("album"); $artist = $album->getNaturalParent("artist"); $desc = $album->getDescription(); 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); } } // Now let's get the art
if (!defined(JZ_SECURE_ACCESS)) { die('Security breach detected.'); } /** * Sitewide settings editor * * @author Ben Dodson * @since 2/2/05 * @version 2/2/05 * **/ global $include_path, $jzUSER, $my_frontend; if ($jzUSER->getSetting('admin') !== true) { exit; } $display = new jzDisplay(); $page_array = array(); $page_array['action'] = 'popup'; $page_array['ptype'] = 'sitesettings'; if (isset($_GET['subpage'])) { $page_array['subpage'] = $_GET['subpage']; } if (isset($_GET['subsubpage'])) { $page_array['subsubpage'] = $_GET['subsubpage']; } if (isset($_GET['set_fe'])) { $page_array['set_fe'] = $_GET['set_fe']; } if (isset($_POST['set_fe'])) { $page_array['set_fe'] = $_POST['set_fe']; }
/** * Actually displays this embedded player * * @author Ross Carlson * @version 3/03/05 * @since 3/03/05 * @param $list an array containing the tracks to be played */ function SERVICE_DISPLAY_PLAYER_xspf($width, $height) { global $root_dir, $this_site, $css; ?> <?php if (!isset($_SERVER['HTTP_REFERER']) || false === strpos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_NAME']) && false === strpos($_SERVER['HTTP_REFERER'], $_SERVER['SERVER_ADDR'])) { // the popup is not resizable. $d = new jzDisplay(); $d->displayJavascript(); ?> <script type="text/javascript"> win=openMediaPlayer(window.location, 300, 150); if (win) { //self.close(); } else { // popup fail this.href=window.location; document.write('<a href="#" <?php echo SERVICE_RETURN_PLAYER_HREF_xspf(); ?> >Click here to open media player.</a>'); } </script> <?php exit; } ?> <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"><!--\ if (window.name == 'embeddedPlayer' && window.innerWidth != <?php echo $width; ?> ) { window.resizeTo(<?php echo $width; ?> ,<?php echo $height; ?> ) } --> </SCRIPT> <?php // Let's setup the page echo '<title>Jinzora XSPF Media Player</title>'; echo '<body leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" bgcolor="#000000">'; $playlist = $this_site . $root_dir . "/temp/playlist.xspf?" . time(); $height = $height - 45; ?> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="440" height="<?php echo $height; ?> " id="xspf_player" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="<?php echo $this_site . $root_dir; ?> /services/services/players/xspf_player.swf?autoplay=true&autoload=true&playlist_url=<?php echo $this_site . $root_dir; ?> /temp/playlist.xspf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#e6e6e6" /> <embed src="<?php echo $this_site . $root_dir; ?> /services/services/players/xspf_player.swf?autoplay=true&autoload=true&playlist_url=<?php echo $this_site . $root_dir; ?> /temp/playlist.xspf" quality="high" bgcolor="#e6e6e6" width="440" height="<?php echo $height; ?> " name="xspf_player" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> <?php exit; }
* - Contributors - * Please see http://www.jinzora.org/team.html * * - Code Purpose - * - This page handles the jukebox display and controls * * @since 01.11.05 * @author Ross Carlson <*****@*****.**> * @author Ben Dodson <*****@*****.**> * - Todo - * Implement detach window: * - use frameElement to determine whether stand-alone or iframe * - find a way to determine if detached window is still onscreen * THAT is the real hard part as there is no knowledge of all open windows in Javascript * SO we must use a variable, but it is erased each time we reload the iframe ... * - do not display anything in the frame is detached window is still on screen * - disable timer on height=0 if we are detached window still on screen * - attach the redock function to body.onunload event w/ knowledge of closed in Mozilla * * @since 07/04/04 * @author Ross Carlson <*****@*****.**> */ // Let's setup the classes $blocks = new jzBlocks(); $display = new jzDisplay(); // Now let's start displaying stuff $display->preheader(false, false, "left", true, true, false); // Now we have to manually add the right javascript - the hover javascript breaks our pretty progress bar echo '<script type="text/javascript" src="' . $root_dir . '/lib/jinzora.js"></script>'; // Now let's include the jukebox settings $blocks->jukeboxBlock($node);
function standardPage(&$node) { global $jinzora_url, $root_dir, $cms_mode, $jzUSER, $jbArr; /* header */ /* use one smarty object so we can use variables in both header and footer */ $display = new jzDisplay(); $smarty = smartySetup(); $path = $node->getPath("String"); $smarty->assign('cms', $cms_mode == "false" ? false : true); $smarty->assign('login_link', $display->loginLink(false, false, true, false, true)); $smarty->assign('jinzora_url', $jinzora_url); $smarty->assign('jinzora_img', $root_dir . '/style/images/slimzora.gif'); $skip_global_css = true; $display->preheader($node->getName(), $this->width, $this->align, true, true, true, $skip_global_css); include_once dirname(__FILE__) . "/css.php"; /* check for playlist queue as action. * jukebox/stream action handled in handleJukeboxVars(). */ handlePlaylistAction(); if (isset($_REQUEST['page'])) { $page = $_REQUEST['page']; } else { $page = "browse"; } $tabs = array(); $tabs[] = array('name' => word('Browse'), 'link' => urlize(array('page' => 'browse', 'jz_path' => $path)), 'selected' => $page == 'browse' ? true : false); $tabs[] = array('name' => word('Lists'), 'link' => urlize(array('page' => 'lists', 'jz_path' => $path)), 'selected' => $page == 'lists' || $page == 'playlist' && isset($_REQUEST['playlist'])); $tabs[] = array('name' => word('Settings'), 'link' => urlize(array('page' => 'settings', 'jz_path' => $path)), 'selected' => $page == 'settings' ? true : false); // tab for media target: if (isset($_SESSION['jz_playlist_queue'])) { if ($_SESSION['jz_playlist_queue'] == 'session') { $plName = word('Quick List'); } else { $plName = $jzUSER->loadPlaylist()->getName(); } $tabs[] = array('name' => $plName, 'link' => urlize(array('page' => 'playlist', 'jz_path' => $path)), 'selected' => $page == 'playlist'); } else { if (checkPlayback() == 'jukebox') { $name = $jbArr[$_SESSION['jb_id']]['description']; $tabs[] = array('name' => $name, 'link' => urlize(array('page' => 'jukebox', 'jz_path' => $path)), 'selected' => $page == 'jukebox'); } } $smarty->assign('tabs', $tabs); jzTemplate($smarty, 'header'); if (file_exists($cfile = dirname(__FILE__) . '/models/' . $page . '.php')) { require_once $cfile; doTemplate($node); } jzTemplate($smarty, 'footer'); }
<?php /* Displays the Jukebox Block * * @author Ben Dodson * @version 12/22/04 * @since 12/22/04 */ global $this_page, $media_dirs, $root_dir, $include_path, $jzUSER, $img_delete, $img_jb_clear, $img_arrow_up, $img_arrow_down; $display = new jzDisplay(); include_once $include_path . "jukebox/class.php"; $jbArr = jzJukebox::getJbArr(); // let's default to stream if (!isset($_SESSION['jb_playwhere'])) { if (checkPermission($jzUSER, "stream")) { $_SESSION['jb_playwhere'] = "stream"; } else { if ($_SESSION['jb_playwhere'] != 'quickbox') { $_SESSION['jb_playwhere'] = $jbArr[0]['description']; } } } $jb_playwhere = $_SESSION['jb_playwhere']; ?> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="jz_block_td" height="100%"> <tr> <td width="5%" valign="top" height="100%"> <nobr> <?php // Now let's create our Jukebox class and connect to it to make sure it works $jb = new jzJukebox();
<?php $display = new jzDisplay(); $display->preheader(); if (checkPlayback() == "jukebox") { echo '<div id="jukebox">'; include jzBlock('jukebox'); echo '</div>'; }
/** * Grabs the data that was parsed from a Podcast * * @author Ross Carlson * @since 11/02/2005 * @param $item An array with all the values to grab * @param $folder The subfolder to store the file in * @return boolean true|false * **/ function getPodcastData($item, $folder) { global $include_path, $podcast_folder; if ($item['file'] == "") { return false; } $be = new jzBackend(); $display = new jzDisplay(); // Let's clean the new folder name $folder = trim(cleanFileName($folder)); // Let's grab the file and save it to disk $ext = substr($item['file'], strlen($item['file']) - 3, 3); $track = trim(cleanFileName($item['title'] . "." . $ext)); if (substr($podcast_folder, 0, 1) != "/") { $dir = str_replace("\\", "/", getcwd()) . "/" . $podcast_folder . "/" . $folder; } else { $dir = $podcast_folder . "/" . $folder; } $track = $dir . "/" . $track; // Now let's create the directory we need makedir($dir); // Now let's see if the file already exists if (!is_file($track)) { ?> <script language="javascript"> t.innerHTML = '<?php echo word("Downloading") . ": " . $display->returnShortName($item['title'], 45); ?> '; --> </SCRIPT> <?php flushdisplay(); // Now let's grab the file and write it out $fName = str_replace("&", "&", $item['file']); $data = file_get_contents($fName); $handle = fopen($track, "w"); fwrite($handle, $data); fclose($handle); ?> <script language="javascript"> t.innerHTML = '<?php echo word("Download Complete!"); ?> '; --> </SCRIPT> <?php flushdisplay(); } else { ?> <script language="javascript"> t.innerHTML = '<?php echo word("Exists - moving to next track..."); ?> '; --> </SCRIPT> <?php flushdisplay(); } return $track; }
function userManSettings($purpose, $settings = false, $subaction = false, $post = false) { global $jzSERVICES, $resampleRates, $include_path; $be = new jzBackend(); $display = new jzDisplay(); $url_array = array(); $url_array['action'] = "popup"; $url_array['ptype'] = "usermanager"; if ($subaction === false) { $url_array['subaction'] = "handleclass"; } else { $url_array['subaction'] = $subaction; } // Why PHP pisses me off. foreach ($settings as $k => $v) { if ($v == "true") { $settings[$k] = true; } else { if ($v == "false") { $settings[$k] = false; } else { $settings[$k] = $v; } } } ?> <form method="POST" action="<?php echo urlize($url_array); ?> "> <input type="hidden" name="update_settings" value="true"> <?php if (is_array($post)) { foreach ($post as $p => $v) { echo '<input type="hidden" name="' . $p . '" value="' . $v . '">'; } } ?> <table> <?php if ($purpose != "custom") { ?> <tr><td width="30%" valign="top" align="right"> <?php echo word("Template:"); ?> </td><td width="70%"> <?php if ($purpose == "new") { ?> <input name="classname" class="jz_input"> <?php } else { if ($purpose == "update") { echo '<input type="hidden" name="classname" class="jz_input" value="' . $_POST['classname'] . '">'; echo $_POST['classname']; } } ?> </td></tr><tr><td> </td><td> </td></tr> <?php } ?> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Interface"); ?> : </td> <td width="70%"> <?php $overCode = $display->returnToolTip(word("INTERFACE_NOTE"), word("Default Interface")); ?> <select <?php echo $overCode; ?> name="usr_interface" class="jz_select" style="width:135px;"> <?php // Let's get all the interfaces $retArray = readDirInfo($include_path . "frontend/frontends", "dir"); sort($retArray); for ($i = 0; $i < count($retArray); $i++) { echo '<option '; if ($settings['frontend'] == $retArray[$i]) { echo 'selected '; } echo 'value="' . $retArray[$i] . '">' . $retArray[$i] . '</option>' . "\n"; } ?> </select> </td> </tr> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Theme"); ?> : </td> <td width="70%"> <?php $overCode = $display->returnToolTip(word("THEME_NOTE"), word("Default Theme")); ?> <select <?php echo $overCode; ?> name="usr_theme" class="jz_select" style="width:135px;"> <?php // Let's get all the interfaces $retArray = readDirInfo($include_path . "style", "dir"); sort($retArray); for ($i = 0; $i < count($retArray); $i++) { if ($retArray[$i] == "images") { continue; } echo '<option '; if ($settings['theme'] == $retArray[$i]) { echo 'selected '; } echo 'value="' . $retArray[$i] . '">' . $retArray[$i] . '</option>' . "\n"; } ?> </select> </td> </tr> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Language"); ?> : </td> <td width="70%"> <?php $overCode = $display->returnToolTip(word("LANGUAGE_NOTE"), word("Default Language")); ?> <select <?php echo $overCode; ?> name="usr_language" class="jz_select" style="width:135px;"> <?php // Let's get all the interfaces $languages = getLanguageList(); for ($i = 0; $i < count($languages); $i++) { echo '<option '; if ($languages[$i] == $settings['language']) { echo ' selected '; } echo 'value="' . $languages[$i] . '">' . $languages[$i] . '</option>' . "\n"; } ?> </select> </td> </tr> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Home Directory"); ?> : </td> <td width="70%"> <?php $overCode = $display->returnToolTip(word("HOMEDIR_NOTE"), word("User Home Directory")); ?> <input <?php echo $overCode; ?> type="input" name="home_dir" class="jz_input" value="<?php echo $settings['home_dir']; ?> "> </td> </tr> <tr> <td width="30%" valign="middle" align="right"> <?php echo word("Home Permissions"); ?> : </td> <td width="70%"> <br> <?php $overCode = $display->returnToolTip(word("HOMEREAD_NOTE"), word("Read Home Directory")); $overCode2 = $display->returnToolTip(word("HOMEADMIN_NOTE"), word("Admin Home Directory")); $overCode3 = $display->returnToolTip(word("HOMEUPLOAD_NOTE"), word("Home Directory Upload")); ?> <input <?php echo $overCode; ?> type="checkbox" name="home_read" class="jz_input" <?php if ($settings['home_read'] == true) { echo 'CHECKED'; } ?> > Read only from home directory<br> <input <?php echo $overCode2; ?> type="checkbox" name="home_admin" class="jz_input" <?php if ($settings['home_admin'] == true) { echo 'CHECKED'; } ?> > Home directory admin<br> <input <?php echo $overCode3; ?> type="checkbox" name="home_upload" class="jz_input" <?php if ($settings['home_upload'] == true) { echo 'CHECKED'; } ?> > Upload to home directory <br><br> </td> </tr> <tr> <td width="30%" valign="middle" align="right"> <?php echo word("User Rights"); ?> : </td> <td width="70%"> <?php $overCode = $display->returnToolTip(word("VIEW_NOTE"), word("User can view media")); $overCode2 = $display->returnToolTip(word("STREAM_NOTE"), word("User can stream media")); $overCode3 = $display->returnToolTip(word("LOFI_NOTE"), word("User can access lo-fi tracks")); $overCode4 = $display->returnToolTip(word("DOWNLOAD_NOTE"), word("User can download")); $overCode5 = $display->returnToolTip(word("POWERSEARCH_NOTE"), word("User can power search")); $overCode6 = $display->returnToolTip(word("JUKEBOXQ_NOTE"), word("User can queue jukebox")); $overCode7 = $display->returnToolTip(word("JUKEBOXADMIN_NOTE"), word("User can admin jukebox")); $overCode8 = $display->returnToolTip(word("SITE_NOTE"), word("Site Admin")); $overCode9 = $display->returnToolTip(word("EDIT_NOTE"), word("Edit Preferences")); $overCode10 = $display->returnToolTip(word("FORCE_CLIPS_NOTE"), word("Force clip mode")); ?> <input <?php echo $overCode; ?> type="checkbox" name="view" class="jz_input" <?php if ($settings['view'] == true) { echo 'CHECKED'; } ?> > View <input <?php echo $overCode2; ?> type="checkbox" name="stream" class="jz_input" <?php if ($settings['stream'] == true) { echo 'CHECKED'; } ?> > Stream <input <?php echo $overCode3; ?> type="checkbox" name="lofi" class="jz_input" <?php if ($settings['lofi'] == true) { echo 'CHECKED'; } ?> > Lo-Fi<br> <input <?php echo $overCode4; ?> type="checkbox" name="download" class="jz_input" <?php if ($settings['download'] == true) { echo 'CHECKED'; } ?> > Download <input <?php echo $overCode5; ?> type="checkbox" name="powersearch" class="jz_input" <?php if ($settings['powersearch'] == true) { echo 'CHECKED'; } ?> > Power Search<br> <input <?php echo $overCode6; ?> type="checkbox" name="jukebox_queue" class="jz_input" <?php if ($settings['jukebox_queue'] == true) { echo 'CHECKED'; } ?> > Jukebox Queue <input <?php echo $overCode7; ?> type="checkbox" name="jukebox_admin" class="jz_input" <?php if ($settings['jukebox_admin'] == true) { echo 'CHECKED'; } ?> > Jukebox Admin<br> <input <?php echo $overCode8; ?> type="checkbox" name="admin" class="jz_input" <?php if ($settings['admin'] == true) { echo 'CHECKED'; } ?> > Site Admin <input <?php echo $overCode9; ?> type="checkbox" name="edit_prefs" class="jz_input" <?php if ($settings['edit_prefs'] == true) { echo 'CHECKED'; } ?> > Edit Prefs <input <?php echo $overCode10; ?> type="checkbox" name="force_clips" class="jz_input" <?php if ($settings['force_clips'] == true) { echo 'CHECKED'; } ?> > Clips Only <br><br> </td> </tr> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Playlist Type"); ?> : </td><td width="70%"> <?php $overCode = $display->returnToolTip(word("PLAYLIST_NOTE"), word("Playlist Type")); ?> <select <?php echo $overCode; ?> name="pltype" class="jz_select" style="width:135px;"> <?php $list = $jzSERVICES->getPLTypes(); foreach ($list as $p => $desc) { echo '<option value="' . $p . '"'; if ($p == $settings['playlist_type']) { echo ' selected'; } echo '>' . $desc . '</option>'; } ?> </select></td></tr> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Resample Rate"); ?> : </td> <td width="70%"> <?php $overCode = $display->returnToolTip(word("RESAMPLE_NOTE"), word("Resample Rate")); $overCode2 = $display->returnToolTip(word("LOCK_NOTE"), word("Resample Rate Lock")); ?> <select <?php echo $overCode; ?> name="resample" class="jz_select" style="width:50px;"> <option value="">-</option> <?php // Now let's create all the items based on their settings $reArr = explode("|", $resampleRates); for ($i = 0; $i < count($reArr); $i++) { echo '<option value="' . $reArr[$i] . '"'; if ($settings['resample_rate'] == $reArr[$i]) { echo ' selected'; } echo '>' . $reArr[$i] . '</option>' . "\n"; } ?> </select> <input <?php echo $overCode2; ?> type="checkbox" name="lockresample" class="jz_input" <?php if ($settings['resample_lock'] == true) { echo 'CHECKED'; } ?> > <?php echo word('Locked'); ?> </td> </tr> <tr> <td width="30%" valign="top" align="right"> <?php echo word("External Player"); ?> : </td> <td width="70%"> <?php $overCode = $display->returnToolTip(word("PLAYER_NOTE"), word("External Player")); ?> <select <?php echo $overCode; ?> name="player" class="jz_select" style="width:135px;"> <option value=""> - </option> <?php // Let's get all the interfaces $retArray = readDirInfo($include_path . "services/services/players", "file"); sort($retArray); for ($i = 0; $i < count($retArray); $i++) { if (!stristr($retArray[$i], ".php") and !stristr($retArray[$i], "qt.")) { continue; } $val = substr($retArray[$i], 0, -4); echo '<option value="' . $val . '"'; if ($settings['player'] == $val) { echo ' selected'; } echo '>' . $val . '</option>' . "\n"; } ?> </select> </td> </tr> <tr> <td width="30%" valign="top" align="right"> <?php echo word("Playback Limit"); ?> : </td> <td width="70%"><td></tr><tr><td></td><td> <table><tr><td> <?php echo word("Limit:"); echo '</td><td>'; $overCode = $display->returnToolTip(word("Sets a streaming limit for users based on the size or number of songs played."), word("Playback Limit")); $cap_limit = $settings['cap_limit']; if (isNothing($cap_limit)) { $cap_limit = 0; } ?> <input <?php echo $overCode; ?> name="cap_limit" class="jz_select" style="width:35px;" value="<?php echo $cap_limit; ?> "> </td></tr> <tr><td> <?php echo word("Method:"); echo '</td><td>'; $overCode = $display->returnToolTip(word("Sets the method for limiting playback"), word("Limiting method")); $cap_method = $settings['cap_method']; ?> <select name="cap_method" class="jz_select" <?php echo $overCode; ?> > <option value="size"<?php if ($cap_method == "size") { echo ' selected'; } ?> ><?php echo word('Size (MB)'); ?> </option> <option value="number"<?php if ($cap_method == "number") { echo ' selected'; } ?> ><?php echo word('Number'); ?> </option> </td></tr> <tr><td> <?php echo word("Duration:"); echo '</td><td>'; $overCode = $display->returnToolTip(word("How long the limit lasts, in days."), word("Limit duration")); $cap_duration = $settings['cap_duration']; if (isNothing($cap_duration)) { $cap_duration = 30; } ?> <input <?php echo $overCode; ?> name="cap_duration" class="jz_select" style="width:35px;" value="<?php echo $cap_duration; ?> "> </td></tr> </table> </tr> <tr> <td width="30%" valign="top"> </td> <td width="70%"> <input type="submit" name="handlUpdate" value="<?php echo word("Save"); ?> " class="jz_submit"> </td> </tr> </table> <?php }
function footer($node = false) { global $root_dir, $jinzora_skin, $img_check, $img_check_none, $jzUSER, $version, $jinzora_url, $show_page_load_time, $allow_lang_choice, $allow_style_choice, $allow_interface_change, $image_dir, $jzSERVICES, $jzUSER, $cms_mode, $allow_theme_change; if ($node === false) { $node = new jzMediaNode(); } $display = new jzDisplay(); ?> <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="1"> <tr class="and_head1"> <td width="50%"> <?php if ($allow_interface_change == "true") { $display->interfaceDropdown(); } ?> </td> <td width="50%" align="right"> <?php // Now let's show the admin tools if ($allow_lang_choice == "true") { $display->languageDropdown(); } else { if ($jzUSER->getSetting('admin')) { $display->systemToolsDropdown($node); } } ?> </td> </tr> <tr> <td> <?php if ($allow_style_choice == "true") { $display->styleDropdown(); } ?> </td> <td align="right"> <?php if ($jzUSER->getSetting('admin') && $allow_lang_choice == "true") { $display->systemToolsDropdown($node); } else { echo ' '; } ?> </td> </table> <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%" align="center"> <?php if ($cms_mode == "false") { $display->loginLink(); } if ($jzUSER->getSetting('edit_prefs') !== false) { if ($cms_mode == "false") { echo " | "; } //echo " - "; $display->popupLink("preferences"); } ?> <br><br> powered by <a href="<?php echo $jinzora_url; ?> ">Jinzora</a> version <?php echo $version; ?> <br><br> <?php if ($show_page_load_time == "true" and $_SESSION['jz_load_time'] != "") { // Ok, let's get the difference $diff = round(microtime_diff($_SESSION['jz_load_time'], microtime()), 3); echo '<br><span class="jz_artistDesc">' . word("generated in") . ": " . $diff . " " . word("seconds") . "</span> <br><br>"; } ?> </td> </tr> </table> <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> </td></tr></table> <?php $jzSERVICES->cmsClose(); }
function footer($node = false) { global $jinzora_url, $this_pgm, $version, $allow_lang_choice, $this_page, $web_root, $root_dir, $allow_theme_change, $cms_mode, $jinzora_skin, $show_loggedin_level, $allow_interface_choice, $jz_lang_file, $shoutcast, $sc_refresh, $sc_host, $sc_port, $sc_password, $url_seperator, $jukebox, $show_jinzora_footer, $hide_pgm_name, $media_dir, $img_sm_logo, $show_page_load_time, $allow_speed_choice, $img_play, $img_random_play, $img_playlist, $config_version, $jzUSER, $allow_style_choice, $jzSERVICES; $display = new jzDisplay(); // First let's make sure they didn't turn the footer off if ($show_jinzora_footer) { ?> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> <td align="center" valign="top"> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> <td class="jz_block_td" align="center" width="25%"> <?php if ($allow_interface_choice == "true") { $display->interfaceDropdown(); } if ($allow_interface_choice == "true" && $allow_style_choice == "true") { echo ' '; } if ($allow_style_choice == "true") { $display->styleDropdown(); } ?> </td> <td class="jz_block_td" align="center" width="50%"> » Powered by Jinzora <?php echo $config_version; ?> « </td> <td class="jz_block_td" align="center" width="25%"> <?php if ($jzUSER->getSetting("admin") == true && $node !== false) { $display->mediaManagementDropdown($node); echo " "; $display->systemToolsDropdown($node); } ?> </td> </tr> </table> </td> </tr> </table></td></tr></table> <a name="pageBottom"></a> <?php } $jzSERVICES->cmsClose(); }
* Please see http://www.jinzora.org/modules.php?op=modload&name=jz_whois&file=index * * Code Purpose: Takes a given path and generates a Podcast feed for it * Created: 9.24.03 by Ross Carlson * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ $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"; }
<?php if (!defined(JZ_SECURE_ACCESS)) { die('Security breach detected.'); } /** * Displays the read more information on an artist from a popup * * @author Ross Carlson * @version 01/19/05 * @since 01/19/05 * @param $node The node that we are viewing */ global $cms_mode, $node; // Let's setup our objects $display = new jzDisplay(); // First let's display the top of the page and open the main block $this->displayPageTop("", word("Profile") . ": " . $node->getName()); $this->openBlock(); // Now let's display the artist image and short description if (($art = $node->getMainArt("200x200")) != false) { $display->image($art, $node->getName(), 200, 200, "limit", false, false, "left", "5", "5"); } if ($cms_mode == "false") { echo '<span class="jz_artistDesc">'; } echo fixAMGUrls($node->getDescription()); if ($cms_mode == "false") { echo '</span>'; } $this->closeBlock();
/** * Displays the top of the page for the popup window * * @author Ross Carlson * @version 01/18/05 * @since 01/18/05 * @param $bg_color a hex value for the background color, IF we want one * @param $headerTitle The title for the page */ function displayPageTop($bg_color = "", $headerTitle = "", $js = true) { global $row_colors, $web_root, $root_dir, $skin, $cms_mode, $cms_type, $cur_theme, $css; $display = new jzDisplay(); //handleSetTheme(); // AJAX: $display->handleAJAX(); // Let's include the javascript if ($js) { echo '<script type="text/javascript" src="' . $root_dir . '/lib/jinzora.js"></script>' . "\n"; echo '<script type="text/javascript" src="' . $root_dir . '/lib/overlib.js"></script>'; echo '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'; } // Let's start our page echo '<title>Jinzora</title>' . "\n"; // Let's output the Jinzora style sheet //include_once($css); echo '<link rel="stylesheet" title="' . $skin . '" type="text/css" media="screen" href="' . $css . '">' . "\n"; // Now let's see if they wanted a different background color if ($bg_color != "") { echo '<span style="font-size:0px">.</span><body marginwidth=0 marginheight=0 style="margin: 0px" style="background-color:' . $bg_color . '">' . "\n"; } // Now let's output the CMS style sheet, if necessary if ($cms_mode != "false") { switch ($cms_type) { case "postnuke": case "phpnuke": case "cpgnuke": case "mdpro": echo '<LINK REL="StyleSheet" HREF="' . $_SESSION['cms-style'] . '" TYPE="text/css">'; // Now let's get the data we need from the session var $cArr = explode("|", urldecode($_SESSION['cms-theme-data'])); echo "<style type=\"text/css\">" . ".jz_row1 { background-color:" . $cArr[0] . "; }" . ".jz_row2 { background-color:" . $cArr[1] . "; }" . ".and_head1 { background-color:" . $cArr[0] . "; }" . ".and_head2 { background-color:" . $cArr[1] . "; }" . "</style>"; break; case "mambo": echo '<LINK REL="StyleSheet" HREF="' . $_SESSION['cms-style'] . '" TYPE="text/css">' . "\n"; $row_colors = array('sectiontableentry2', 'tabheading'); break; } } if (stristr($skin, "/")) { $img_path = $root_dir . "/" . $skin; } else { $img_path = $root_dir . "/style/" . $skin; } // Now let's show the page title if ($headerTitle != "") { ?> <table width="100%" cellpadding="3" cellspacing="0" border="0"><tr><td> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td width="6" height="6" style="background: url(<?php echo $img_path; ?> /inner-block-top-left.gif); background-repeat:no-repeat"></td> <td width="99%" height="6" style="background: url(<?php echo $img_path; ?> /inner-block-top-middle.gif);"></td> <td width="6" height="6" style="background: url(<?php echo $img_path; ?> /inner-block-top-right.gif); background-repeat:no-repeat"></td> </tr> <tr> <td width="6" style="background: url(<?php echo $img_path; ?> /inner-block-left.gif); background-repeat:repeat"></td> <td width="99%"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="100%"> <font size="1" color="<?php echo jz_font_color; ?> "> <strong><?php echo $headerTitle; ?> </strong> </font> </td> <td align="right"><a href="javascript:window.close();"><?php echo word('Close'); ?> </a></td> </tr> </table> </td> <td width="6" style="background: url(<?php echo $img_path; ?> /inner-block-right.gif); background-repeat:repeat"></td> </tr> <tr> <td width="6" height="6" style="background: url(<?php echo $img_path; ?> /inner-block-bottom-left.gif); background-repeat:no-repeat"></td> <td width="99%" height="6" style="background: url(<?php echo $img_path; ?> /inner-block-bottom-middle.gif);"></td> <td width="6" height="6" style="background: url(<?php echo $img_path; ?> /inner-block-bottom-right.gif); background-repeat:no-repeat"></td> </tr> </table> </td></tr></table> <?php } flushDisplay(); }
$dirtyFlag = true; $nameParts = explode('/', $imgName); $imgShortName = $nameParts[count($nameParts) - 1]; $meta['pic_mime'] = $mimeType; $meta['pic_data'] = $imageData; $meta['pic_ext'] = $picExt; $meta['pic_name'] = $imgShortName; } } if ($dirtyFlag) { $node->bulkMetaUpdate($meta); } } $this->displayPageTop("", word("Item Information for") . ": " . $node->getName()); $this->openBlock(); $display = new jzDisplay(); // Let's setup our form $arr = array(); $arr['action'] = "popup"; $arr['ptype'] = "iteminfo"; $arr['jz_path'] = $_GET['jz_path']; echo '<form action="' . urlize($arr) . '" method="POST" enctype="multipart/form-data">'; // Ok, now let's see what they can edit? $i = 0; ?> <table class="jz_track_table" width="100%" cellpadding="5" cellspacing="0" border="0"> <?php $artist = $node->getAncestor("artist"); if ($artist !== false) { ?> <tr class="<?php
/** * Returns the AJAX code for the NSB * * @author Ross Carlson * @since 8.21.05 * **/ function returnNowStreaming() { global $jzUSER, $img_tiny_play, $im_tiny_play_dis, $css, $img_tiny_info, $skin, $root_dir, $include_path, $jzSERVICES, $who_is_where_height; $define_only = true; //include_once($include_path. $css); writeLogData("messages", "NSB: starting up"); // Now let's figure out the height $be = new jzBackend(); $display = new jzDisplay(); $tracks = $be->getPlaying(); $retVal = ""; $count = 0; foreach ($tracks as $sid => $song) { // Let's make sure we got data if (count($song) != 0) { // Now let's setup for our links $url_array = array(); $url_array['jz_path'] = $song['path']; $url_array['action'] = "playlist"; $url_array['type'] = "track"; $urlArr = array(); $urlArr['session'] = $sid; $urlArr['action'] = "popup"; $urlArr['ptype'] = "viewcurrentinfo"; $infoLink = '<a href="' . str_replace("ajax_request", "index", urlize($urlArr)) . '" onclick="openPopup(this, 450, 300); return false;">' . $img_tiny_info . '</a>'; $arr = array(); $pArr = explode("/", $song['path']); unset($pArr[count($pArr) - 1]); $arr['jz_path'] = implode("/", $pArr); $songTrack = $display->returnShortName($song['track'], 15); /* if ($lyricsLink == ""){ $songTrack = $display->returnShortName($song['track'],15); } else { $songTrack = $display->returnShortName($song['track'],13); } */ $track = new jzMediaNode($song['path']); $item = $track->getParent(); if ($item->getPType() == "disk") { $item = $item->getParent(); } $album = $item->getName(); $artParent = $item->getParent(); $artist = $artParent->getName(); $art = $item->getMainArt("75x75"); if ($art) { $albumImage = str_replace("'", "\\'", str_replace('"', '', $display->returnImage($art, $album, 75, 75, "limit", false, false, "left", "3", "3"))); } else { $albumImage = ""; } $desc_truncate = 200; $desc = htmlentities(str_replace("'", "\\'", str_replace('"', '', $item->getDescription()))); // Now let's set the title and body $title = htmlentities(str_replace("'", "\\'", str_replace('"', '', $artist . " - " . $song['track']))); $userName = $song['name']; if ($userName == "") { $userName = word("Anonymous"); } if ($song['fullname'] != "") { $userName = $song['fullname']; } $body = "<strong>" . word("Streaming to: ") . $userName . "</strong><br>" . $albumImage . $display->returnShortName($desc, $desc_truncate); //$albumImage; $count++; if ($jzUSER->getSetting('stream')) { $retVal .= ' <a href="' . str_replace("ajax_request.php", "index.php", urlize($url_array)) . '"'; if (checkPlayback() == "embedded") { //$jzSERVICES = new jzServices(); $jzSERVICES->loadUserServices(); $retVal .= ' ' . $jzSERVICES->returnPlayerHref(); } $retVal .= '>' . $img_tiny_play . '</a>' . $infoLink . '<a ' . $display->returnToolTip($body, $title) . ' target="_parent" href="' . str_replace("ajax_request", "index", urlize($arr)) . '">' . $songTrack . '</a><br>'; } else { $retVal .= '' . $img_tiny_play_dis . '' . $infoLink . '<a ' . $display->returnToolTip($body, $title) . ' target="_parent" ' . $title . ' href="' . str_replace("ajax_request", "index", urlize($arr)) . '">' . $songTrack . '</a><br>'; } } } if ($count == 1 or $count == 0) { $tCtr = ""; } else { $tCtr = " (" . $count . ")"; } $retVal = "<strong>" . word("Now Streaming") . $tCtr . "</strong><br />" . $retVal; $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", "NSB: displaying data"); echo $retVal; exit; }
<?php $smarty = smartySetup(); $display = new jzDisplay(); $desc = $node->getDescription(); if (isNothing($desc)) { return false; } if ($desc_truncate === false) { $desc_truncate = 700; } $smarty->assign('description', $display->returnShortName($desc, $desc_truncate)); $smarty->assign('read_more', ""); if (strlen($desc) > $desc_truncate) { $url_array = array(); $url_array['jz_path'] = $node->getPath("String"); $url_array['action'] = "popup"; $url_array['ptype'] = "readmore"; $smarty->assign('read_more', '<a href="' . urlize($url_array) . '" onclick="openPopup(this, 450, 450); return false;">...read more</a>'); } jzTemplate($smarty, 'description');
function footer() { global $root_dir, $jinzora_url, $jzSERVICES, $cms_mode, $jzUSER; $display = new jzDisplay(); echo "<center>"; if ($cms_mode == "false") { $display->loginLink(); } if ($jzUSER->getSetting('edit_prefs') !== false) { if ($cms_mode == "false") { echo " | "; } $display->popupLink("preferences"); } echo '<br><a href="' . $jinzora_url . '" target="_blank"><img src="' . $root_dir . '/style/images/slimzora.gif" border="0"></a><br><br>'; echo '</td></tr></table>'; $jzSERVICES->cmsClose(); }
/** * Creates a small version of the jukebox block. * * @author Ben Dodson * @since 4/29/05 * @version 4/29/05 * @param text: the text to display in the box. 'off' means no text. * @buttons: one of: "top|default|off". Top means toggle with the header text when applicable. **/ function smallJukebox($text = false, $buttons = "default", $linebreaks = true) { global $jbArr, $jzUSER, $include_path, $jukebox_display; if ($text == "") { $text = false; } $display = new jzDisplay(); include_once $include_path . "jukebox/class.php"; $jb = new jzJukebox(); if (!$jb->connect()) { echo '<strong>Error connecting to jukebox. Please make sure your jukebox settings are correct. (jukebox/settings.php)</strong>'; $jb_playwhere = ""; } else { if (isset($_SESSION['jb_playwhere'])) { $jb_playwhere = $_SESSION['jb_playwhere']; } else { $jb_playwhere = "stream"; } } $url_array = array(); $url_array['action'] = "popup"; $url_array['ptype'] = "jukezora"; ?> <script> sm_text = '<?php echo $text; ?> '; sm_buttons = '<?php echo $buttons; ?> '; sm_linebreaks = '<?php echo $linebreaks; ?> '; </script> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td width="100%" valign="top"> <?php $showText = true; if ($buttons == "top" && checkPermission($jzUSER, "jukebox_admin") === true && $_SESSION['jb_playwhere'] != "stream") { // Ok, now we need to make sure we can do things $func = $jb->jbAbilities(); echo "<nobr>"; if ($func['playbutton']) { $display->displayJukeboxButton("play"); $showText = false; } if ($func['pausebutton']) { $display->displayJukeboxButton("pause"); $showText = false; } if ($func['stopbutton']) { $display->displayJukeboxButton("stop"); $showText = false; } if ($func['nextbutton']) { $display->displayJukeboxButton("previous"); $showText = false; } if ($func['prevbutton']) { $display->displayJukeboxButton("next"); $showText = false; } if ($func['shufflebutton']) { //$display->displayJukeboxButton("random_play"); //$showText = false; } if ($func['clearbutton']) { $display->displayJukeboxButton("clear"); $showText = false; } echo "</nobr>"; } if ($showText) { ?> <?php if (isNothing($text)) { ?> <font size="1"> <strong> <?php if (checkPlayback() == "jukebox") { $theJWord = word("Jukebox"); } else { $theJWord = word("Playback"); } $display->popupLink("jukezora", $theJWord); if (checkPlayback() == "jukebox") { $jz_jbstatus = $jb->getPlayerStatus(); echo " - " . ucwords($jz_jbstatus); } ?> </strong> </font> <?php } else { if ($text != "off") { echo $text; } } ?> <?php } ?> </td> </tr> <tr> <td width="100%" valign="top"> <?php $arr = array(); $arr['action'] = "jukebox"; $arr['subaction'] = "jukebox-command"; $arr['command'] = "playwhere"; ?> <form action="<?php echo urlize($arr); ?> " method="POST" name="playbackForm"> <select name="jbplaywhere" id="smallJukeboxSelect" class="jz_select" style="width:132;" onChange="updateSmallJukebox()"> <?php if (checkPermission($jzUSER, 'stream')) { ?> <option value="stream">Stream</option> <?php } // Now let's get a list of all the jukeboxes that are installed for ($i = 0; $i < count($jbArr); $i++) { echo '<option '; if ($jb_playwhere == $jbArr[$i]['description']) { echo " selected "; } echo 'value="' . $jbArr[$i]['description'] . '">' . $jbArr[$i]['description'] . '</option>'; } ?> </select> </form> <?php if ($linebreaks) { echo '</td></tr><tr><td width="100%">'; } else { echo "   "; } if ($jb_playwhere != "stream" && checkPermission($jzUSER, "jukebox_admin") === true && $buttons == "default") { // Ok, now we need to make sure we can do things $func = $jb->jbAbilities(); echo "<nobr>"; if ($func['playbutton']) { $display->displayJukeboxButton("play"); } if ($func['pausebutton']) { $display->displayJukeboxButton("pause"); } if ($func['stopbutton']) { $display->displayJukeboxButton("stop"); } if ($func['nextbutton']) { $display->displayJukeboxButton("previous"); } if ($func['prevbutton']) { $display->displayJukeboxButton("next"); } if ($func['shufflebutton']) { //$display->displayJukeboxButton("random_play"); } if ($func['clearbutton']) { $display->displayJukeboxButton("clear"); } echo "</nobr>"; } ?> </td> </tr> </table> <?php }
function footer($node = false) { global $jinzora_url, $allow_interface_change, $show_full_footer, $version; $display = new jzDisplay(); if ($allow_interface_change == "true") { $display->interfaceDropdown(); } if ($show_full_footer == "true") { $diff = round(microtime_diff($_SESSION['jz_load_time'], microtime()), 3); echo word("generated in") . ": " . $diff . " " . word("seconds") . "<br>"; echo 'powered by <a href="' . $jinzora_url . '">Jinzora</a> version ' . $version; } }