function doTemplate($node) { global $jbArr, $jzUSER; $display =& new jzDisplay(); $smarty = mobileSmarty(); $smarty->assign('Playback', word('Playback')); $smarty->assign('SendToDevice', word('Send to Device:')); $smarty->assign('AddToPlaylist', word('Add to Playlist:')); $path = $node->getPath("String"); $url = array('jz_path' => $path, 'page' => 'settings'); $pbt = array(); $playlists = array(); $url['jz_player'] = 'stream'; $url['jz_player_type'] = 'stream'; $selected = !actionIsQueue() && checkPlayback() == 'stream'; $pbt[] = array('label' => word('Stream media'), 'url' => urlize($url), 'selected' => $selected); $url['jz_player_type'] = 'jukebox'; if (isset($jbArr) && is_array($jbArr)) { for ($i = 0; $i < sizeof($jbArr); $i++) { $url['jz_player'] = $i; $url['jz_player_type'] = 'jukebox'; $selected = !actionIsQueue() && checkPlayback() == 'jukebox' && $_SESSION['jb_id'] == $i; $pbt[] = array('label' => word('Send to %s', $jbArr[$i]['description']), 'url' => urlize($url), 'selected' => $selected); } } $smarty->assign('devices', $pbt); /* playlists */ $url['jz_player_type'] = 'playlist'; $url['jz_player'] = 'session'; $selected = actionIsQueue() && $_SESSION['jz_playlist_queue'] == 'session'; $playlists[] = array('label' => word('Quick List'), 'url' => urlize($url), 'selected' => $selected); $lists = $jzUSER->listPlaylists("static"); foreach ($lists as $id => $plName) { $url['jz_player'] = $id; $selected = actionIsQueue() && $_SESSION['jz_playlist_queue'] == $id; $playlists[] = array('label' => $plName, 'url' => urlize($url), 'selected' => $selected); } $smarty->assign('playlists', $playlists); $url['jz_player'] = 'new'; $smarty->assign('newList', array('href' => '#', 'onclick' => "window.location='" . urlize($url) . "'.concat('&playlistname='.concat(document.getElementById('playlistname').value)); return true;", 'name' => word('My Playlist'), 'inputID' => word('playlistname'), 'label' => word('New list:'), 'selected' => false)); jzTemplate($smarty, 'settings'); }
/** * 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 }
/** * Does the default action on this playlist (play|jukebox) * * @author Ben Dodson <*****@*****.**> * @version 11/12/04 * @since 11/12/04 */ function play() { global $jukebox, $jzUSER, $jz_path; if (checkPermission($jzUSER, 'play', $jz_path) === false) { return false; } $l = $this; $l->flatten(); if (sizeof($l->list) == 0) { return; } if (checkPlayback() == 'jukebox') { $l->jukebox(); } else { $l->stream(); } }
<?php $display = new jzDisplay(); $display->preheader(); if (checkPlayback() == "jukebox") { echo '<div id="jukebox">'; include jzBlock('jukebox'); echo '</div>'; }
/** * 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; }
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'); }
/** * Echos the extra code needed * to make the embedded player * work in a new window during * a form submit. * * @author Ben Dodson * @version 4/17/05 * @since 4/17/05 **/ function embeddedFormHandler($formname = false) { global $jzUSER, $jzSERVICES; if ($formname === false) { $formname = "albumForm"; } if (checkPlayback() == "embedded") { // Ok, let's put the popup in the href return $jzSERVICES->returnPlayerFormLink($formname); } }
echo $keyword_random; ?> '; key3 = key3.toUpperCase(); if (!(str.match(key1) || str.match(key2) || str.match(key3))) { f.target='_self'; return true; } if (playback == 'jukebox') { ajax_submit_form(f,url,sendJukeboxRequest_cb); return false; } <?php if (checkPlayback(true) == 'embedded') { ?> else { // if (playback == 'embedded') { win = openMediaPlayer('',<?php echo $jzSERVICES->returnPlayerWidth(); ?> ,<?php echo $jzSERVICES->returnPlayerHeight(); ?> ); f.target='embeddedPlayer'; return true; } <?php } else { ?>
if (isset($nArr[$i])) { $plist->add($nArr[$i]); } } // Now let's store it $jzUSER->storePlaylist($plist, $plName); // Now let's read the list again $list = $plist->getList(); } $arr2 = array(); $arr2['action'] = "playlist"; $arr2['type'] = "playlist"; $arr2['jz_pl_id'] = $plist->getID(); $arr2['plowner'] = $jzUSER->getID(); echo '<strong><a href="' . urlize($arr2) . '"'; if (checkPlayback() == "embedded") { echo ' ' . $jzSERVICES->returnPlayerHref(); } echo '>' . word('Play this list') . '</a></strong>'; // Now we need to setup a table to display the list in $i = 1; ?> <form action=" <?php echo urlize($arr); ?> " method="POST"> <table class="jz_track_table" width="100%" cellpadding="1"> <tr> <!--<td width="1%"> <nobr> Playlist Type: