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, $skin, $bg_c, $text_c, $img_discuss_dis, $hierarchy, $random_albums, $frontend, $include_path, $cols_in_genre, $show_frontpage_items, $show_alphabet, $chart_types; // Let's setup the display object $smarty = smartySetup(); $blocks = new jzBlocks(); // Let's get the site news $site_news = $blocks->siteNews($node); $smarty->assign('smarty_include', getcwd()); $smarty->assign('site_news', $site_news); $smarty->assign('word_site_news', word("Site News")); // Now let's show the feature artist/album if ($node->getName() != "") { $smarty->assign('editor_pick_title', word("Editors Pick") . ": " . $node->getName()); $smarty->assign('jz_bg_color', jz_bg_color); } // Now let's see if we need the featured block or not $smarty->assign('show_featured', false); if ($node->getLevel() == 0) { if ($blocks->showFeaturedBlock($node, true)) { $smarty->assign('show_featured', true); //$smarty->assign('featured_data', $blocks->showFeaturedBlock($node)); } } // Now let's display the templates $smarty->display(SMARTY_ROOT . 'templates/slick/genre.tpl'); }
function doTemplate($node) { global $jzUSER; $display =& new jzDisplay(); $smarty = mobileSmarty(); $smarty->assign('Play', word('Play')); $smarty->assign('Shuffle', word('Shuffle')); if (!isset($_REQUEST['playlist']) && !isset($_SESSION['jz_playlist_queue'])) { jzTemplate($smart, 'playlist'); return; } $elements = array(); if (isset($_REQUEST['playlist'])) { $pl = $jzUSER->loadPlaylist($_REQUEST['playlist']); } else { $pl = $jzUSER->loadPlaylist($_SESSION['jz_playlist_queue']); } $smarty->assign('plName', $pl->getName()); $smarty->assign('openPlayTag', $display->getOpenPlayTag($pl)); $smarty->assign('openShuffleTag', $display->getOpenPlayTag($pl, true)); $smarty->assign('isStatic', $pl->getPLType() == 'static'); $list = $pl->getList(); foreach ($list as $el) { $elements[] = array('name' => $el->getName(), 'openPlayTag' => $display->getOpenPlayTag($el)); } $smarty->assign('elements', $elements); jzTemplate($smarty, 'playlist'); }
function footer() { global $jinzora_url, $this_pgm, $version, $root_dir, $show_page_load_time, $skin, $show_jinzora_footer, $jzSERVICES, $cms_mode; // First let's make sure they didn't turn the footer off if ($show_jinzora_footer) { $display = new jzDisplay(); $smarty = smartySetup(); $smarty->assign('jinzora_url', $jinzora_url); $smarty->assign('link_title', $this_pgm . " " . $version); $poweredby = $root_dir . '/style/' . $skin . '/powered-by-small.gif'; if (!file_exists($poweredby)) { $poweredby = $root_dir . '/style/images/powered-by-small.gif'; } $smarty->assign('logo', $poweredby); $smarty->assign('page_load_time', ""); 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); if ($cms_mode == "false") { $page_load = '<span class="jz_artistDesc">'; } $page_load .= word("Page generated in") . ": " . $diff . " " . word("seconds"); if ($cms_mode == "false") { $page_load .= "</span>"; } $smarty->assign('page_load_time', $page_load); } // Now let's display $smarty->display(SMARTY_ROOT . 'templates/slick/block-footer.tpl'); } $jzSERVICES->cmsClose(); }
function getDynamicFunctions() { $f = array(); $f['random'] = word('Randomly Selected'); $f['topplayed'] = word('Most Played'); $f['recentlyadded'] = word('Recently Added'); $f['similar'] = word('Similar'); //$f['exact'] = word('All Tracks'); // Available, but dont add to dropdown return $f; }
/** * Displays the random albums block * @author Ross Carlson * @version 12/22/04 * @since 12/22/04 * @param object $node the node that we are looking at * @param string $level The level we are looking at, like a subartist */ function classicRandomAlbums(&$node, $level = "") { global $hierarchy; $title = word("Random Albums"); if ($node->getName() != "") { $title = word("Random Albums") . " :: " . $node->getName(); } $this->blockHeader($title); $this->blockBodyOpen(); $this->randomAlbums($node, $level); $this->blockBodyClose(); }
function doTemplate($node) { global $jzUSER, $display, $chart_size; $display =& new jzDisplay(); $smarty = mobileSmarty(); $smarty->assign('Play', word('Play')); $smarty->assign('Shuffle', word('Shuffle')); /** Playlists **/ $smarty->assign('Playlists', word('Playlists')); $editPage = array('page' => 'playlist'); $sm_lists = array(); $l = $jzUSER->loadPlaylist("session"); if ($l->length() > 0) { $sm_lists[] = array('name' => word("Quick List"), 'openPlayTag' => $display->getOpenPlayTag($l), 'editHREF' => urlize($editPage, array('playlist' => 'session')), 'isStatic' => true, 'openShuffleTag' => $display->getOpenPlayTag($l, true)); } $lists = $jzUSER->listPlaylists("static") + $jzUSER->listPlaylists("dynamic"); // use "all" to mix ordering foreach ($lists as $id => $plName) { $l = $jzUSER->loadPlaylist($id); $static = $l->getPLType() == 'static' ? true : false; $sm_lists[] = array('name' => $plName, 'openPlayTag' => $display->getOpenPlayTag($l), 'editHREF' => urlize($editPage, array('playlist' => $id)), 'isStatic' => $static, 'openShuffleTag' => $display->getOpenPlayTag($l, true)); } $smarty->assign('playlists', $sm_lists); /** Charts **/ /** * array of titles and lists */ $root = new jzMediaNode(); $charts = array(); /* recently added albums */ $chart = array(); $chart['title'] = word('New Albums'); $entries = array(); $list = $root->getRecentlyAdded('nodes', distanceTo('album'), $chart_size); for ($i = 0; $i < sizeof($list); $i++) { $entries[] = array('name' => $list[$i]->getName(), 'link' => urlize(array('jz_path' => $list[$i]->getPath("String"))), 'openPlayTag' => $display->getOpenPlayTag($list[$i])); } $chart['entries'] = $entries; $charts[] = $chart; /* recently played albums */ $chart = array(); $chart['title'] = word('Recently Played Albums'); $entries = array(); $list = $root->getRecentlyPlayed('nodes', distanceTo('album'), $chart_size); for ($i = 0; $i < sizeof($list); $i++) { $entries[] = array('name' => $list[$i]->getName(), 'link' => urlize(array('jz_path' => $list[$i]->getPath("String"))), 'openPlayTag' => $display->getOpenPlayTag($list[$i])); } $chart['entries'] = $entries; $charts[] = $chart; $smarty->assign('charts', $charts); jzTemplate($smarty, 'lists'); }
function imagebmp(&$img, $filename = false) { $wid = imagesx($img); $hei = imagesy($img); $wid_pad = str_pad('', $wid % 4, ""); $size = 54 + ($wid + $wid_pad) * $hei * 3; //fixed //prepare & save header $header['identifier'] = 'BM'; $header['file_size'] = dword($size); $header['reserved'] = dword(0); $header['bitmap_data'] = dword(54); $header['header_size'] = dword(40); $header['width'] = dword($wid); $header['height'] = dword($hei); $header['planes'] = word(1); $header['bits_per_pixel'] = word(24); $header['compression'] = dword(0); $header['data_size'] = dword(0); $header['h_resolution'] = dword(0); $header['v_resolution'] = dword(0); $header['colors'] = dword(0); $header['important_colors'] = dword(0); if ($filename) { $f = fopen($filename, "wb"); foreach ($header as $h) { fwrite($f, $h); } //save pixels for ($y = $hei - 1; $y >= 0; $y--) { for ($x = 0; $x < $wid; $x++) { $rgb = imagecolorat($img, $x, $y); fwrite($f, byte3($rgb)); } fwrite($f, $wid_pad); } fclose($f); } else { foreach ($header as $h) { echo $h; } //save pixels for ($y = $hei - 1; $y >= 0; $y--) { for ($x = 0; $x < $wid; $x++) { $rgb = imagecolorat($img, $x, $y); echo byte3($rgb); } echo $wid_pad; } } }
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'); }
function doTemplate($node) { $display =& new jzDisplay(); $smarty = mobileSmarty(); $breadcrumbs = array(); if (isset($_REQUEST['jz_path'])) { $me = $node; while ($me->getLevel() > 0) { $breadcrumbs[] = array("name" => $me->getName(), "link" => urlize(array('jz_path' => $me->getPath("String")))); $me = $me->getParent(); } } $breadcrumbs[] = array("name" => word("Home"), "link" => urlize(array())); $smarty->assign('breadcrumbs', $breadcrumbs); if (actionIsQueue()) { $smarty->assign('Play', word('Add')); } else { $smarty->assign('Play', word('Play')); } $myNodes = $node->getSubNodes('nodes'); sortElements($myNodes); $myTracks = $node->getSubNodes('tracks'); $nodes = array(); for ($i = 0; $i < sizeof($myNodes); $i++) { $e = $myNodes[$i]; $nodes[] = smartyNode($myNodes[$i]); } $smarty->assign('nodes', $nodes); $tracks = array(); for ($i = 0; $i < sizeof($myTracks); $i++) { $e = $myNodes[$i]; $tracks[] = smartyTrack($myTracks[$i]); } $smarty->assign('tracks', $tracks); jzTemplate($smarty, 'browse'); }
function standardPage(&$node) { global $jinzora_skin, $root_dir, $row_colors, $image_size, $desc_truncate, $image_dir, $jzSERVICES, $show_frontpage_items, $show_artist_alpha, $sort_by_year; // Let's setup the objects $blocks =& new jzBlocks(); $display =& new jzDisplay(); $fe =& new jzFrontend(); // Let's display the header $this->pageTop($node); // Now let's get the sub nodes to where we are if (isset($_GET['jz_letter'])) { $root = new jzMediaNode(); $nodes = $root->getAlphabetical($_GET['jz_letter'], "nodes", distanceTo("artist")); } else { if ($node->getLevel() == 0 && $show_frontpage_items == "false") { $nodes = array(); } else { $nodes = $node->getSubNodes("nodes"); } } // Now let's sort if ($sort_by_year == "true" and $node->getPType() == "artist") { sortElements($nodes, "year"); } else { sortElements($nodes, "name"); } echo '<form name="albumForm" method="POST" action="' . urlize() . '">'; echo '<input type="hidden" name="' . jz_encode('jz_list_type') . '" value="' . jz_encode('nodes') . '">'; // Now let's loop through the nodes $i = 0; foreach ($nodes as $item) { ?> <table width="100%" cellspacing="0" cellpadding="4"> <tr class="<?php $i = 1 - $i; echo $row_colors[$i]; ?> "> <td width="1%" valign="middle"> <input type="checkbox" name="jz_list[]" value="<?php echo jz_encode($item->getPath("String")); ?> "> </td> <td width="1%" valign="middle"> <?php $display->link($item, '<img src="' . $image_dir . 'folder.gif" border="0">'); ?> </td> <td width="96%" valign="middle"> <?php // Now let's link to this item $name = $item->getName(); if (!isNothing($item->getYear()) and $item->getPType() == "album") { $name .= " (" . $item->getYear() . ")"; } $display->link($item, $name); ?> </td> <td width="1%" valign="middle" nowrap align="right"> <?php // Now let's show the sub items if (($count = $item->getSubNodeCount("nodes")) != 0) { if ($count > 1) { $folder = word("folders"); } else { $folder = word("folder"); } $display->link($item, $count . " " . $folder); } else { if (($count = $item->getSubNodeCount("tracks")) != 0) { if ($count > 1) { $files = word("files"); } else { $files = word("file"); } $display->link($item, $count . " " . $files); } } ?> </td> <td width="1%" valign="middle" nowrap align="right"> <?php // Let's show a play button $display->playButton($item); echo " "; $display->randomPlayButton($item); ?> </td> </tr> <?php // Now do we hvae another row? if (($art = $item->getMainArt($image_size . "x" . $image_size)) != false or ($desc = $item->getDescription()) != "") { // Ok, we had stuff let's do a new row ?> <tr class="<?php echo $row_colors[$i]; ?> "> <td width="1%" valign="middle"> </td> <td width="99%" valign="middle" colspan="4"> <?php if ($art) { $display->link($item, $display->returnImage($art, $node->getName(), $image_size, $image_size, "limit", false, false, "left", "4", "4")); } echo $display->returnShortName($item->getDescription(), $desc_truncate); // Do we need the read more link? if (strlen($item->getDescription()) > $desc_truncate) { $url_array = array(); $url_array['jz_path'] = $item->getPath("String"); $url_array['action'] = "popup"; $url_array['ptype'] = "readmore"; echo ' <a href="' . urlize($url_array) . '" onclick="openPopup(this, 450, 450); return false;">...read more</a>'; } ?> </td> </tr> <?php } ?> </table> <table width="100%" cellspacing="0" cellpadding="0"><tr bgcolor="#D2D2D2"><td width="100%"></td></tr></table> <?php } // Now are there any tracks? if (isset($_GET['jz_letter'])) { $root = new jzMediaNode(); //$tracks = $root->getAlphabetical($_GET['jz_letter'],"tracks",-1); $tracks = array(); } else { $tracks = $node->getSubNodes("tracks"); } if (count($tracks) != 0) { $blocks->trackTable($tracks); } if (sizeof($nodes) > 0 || sizeof($tracks) > 0) { ?> <table width="100%" cellspacing="0" cellpadding="0"><tr height="2" style="background-image: url('<?php echo $image_dir; ?> row-spacer.gif');"><td width="100%"></td></tr></table> <table width="100%" cellspacing="0" cellpadding="3"> <tr class="and_head1"> <td width="100%"> <a style="cursor:hand" onClick="CheckBoxes('albumForm',true); return false;" href="javascript:;"><img src="<?php echo $image_dir; ?> check.gif" border="0"></a><a style="cursor:hand" onClick="CheckBoxes('albumForm',false); return false;" href="javascript:;"><img src="<?php echo $image_dir; ?> check-none.gif" border="0"></a> <?php $display->addListButton(); ?> <?php $display->hiddenVariableField('action', 'mediaAction'); ?> <?php $display->hiddenVariableField('path', $_GET['jz_path']); ?> <?php $url_array = array(); $url_array['action'] = "popup"; $url_array['ptype'] = "playlistedit"; echo '<a href="javascript:;" onClick="openPopup(' . "'" . urlize($url_array) . "'" . ',600,600); return false;"><img src="' . $image_dir . 'playlist.gif" border="0"></a>'; echo ' '; $display->playlistSelect(115, false, "all"); ?> </form> </td> </tr> </table> <?php } echo '</form>'; // Now let's close out $this->footer($node); }
$name .= " (" . $item->getYear() . ")"; } $array[$i]['name'] = $display->link($item, $name, false, false, true); if (($count = $item->getSubNodeCount("nodes")) != 0) { if ($count > 1) { $folder = word("folders"); } else { $folder = word("folder"); } $array[$i]['items'] = $display->link($item, $count . " " . $folder, false, false, true); } else { if (($count = $item->getSubNodeCount("tracks")) != 0) { if ($count > 1) { $files = word("files"); } else { $files = word("file"); } $array[$i]['items'] = $display->link($item, $count . " " . $files, false, false, true); } } $array[$i]['play_button'] = $display->playButton($item, false, false, false, true); $array[$i]['random_button'] = $display->randomPlayButton($item, false, false, false, true); // Now do we hvae another row? $array[$i]['subitems'] = false; if (($art = $item->getMainArt($image_size . "x" . $image_size)) != false or ($desc = $item->getDescription()) != "") { $array[$i]['subitems'] = true; $array[$i]['art'] = false; if ($art) { $array[$i]['art'] = $display->link($item, $display->returnImage($art, $node->getName(), $image_size, $image_size, "limit", false, false, "left", "4", "4"), false, false, true); } $array[$i]['desc'] = $display->returnShortName($item->getDescription(), $desc_truncate);
function handleFrontendOverrides() { global $img_play, $img_tiny_play, $fe; $img_play = '<img src="frontend/frontends/' . $fe->name . '/img/play.gif" border=0 alt="' . word("Play") . '" title="' . word("Play") . '">'; $img_tiny_play = '<img src="frontend/frontends/' . $fe->name . '/img/play.gif" border=0 alt="' . word("Play") . '" title="' . word("Play") . '">'; ?> <style> td { font-size:20px; } a { font-size:24px; } </style> <?php }
/** * Turns a string with potentially weird characters into a valid path. * * @author Ben Dodson * @version 6/9/04 * @since 6/9/04 */ function pathize($str, $char = '_') { $str = preg_replace("/[^a-z|A-Z|0-9| |,|'|\"|(|)|.|-|_|+|=]/", $char, $str); if ($str == "" || $str == "-") { $str = word("Unknown"); } return $str; }
function doTemplate($node) { global $jzUSER; $display =& new jzDisplay(); $smarty = mobileSmarty(); $jb = new jzJukebox(); if (!$jb->connect()) { //jzTemplate($smarty,'jukeboxError'); echo 'Error connecting to jukebox.'; return; } $smarty->assign('Play', word('Play')); $smarty->assign('Pause', word('Pause')); $smarty->assign('Stop', word('Stop')); $smarty->assign('Previous', word('Previous')); $smarty->assign('Next', word('Next')); $smarty->assign('Shuffle', word('Shuffle')); $smarty->assign('Clear', word('Clear')); /* buttons */ if (checkPermission($jzUSER, "jukebox_admin")) { $func = $jb->jbAbilities(); if ($func['playbutton']) { $smarty->assign('openPlayTag', $display->getOpenJukeboxActionTag('play')); } if ($func['pausebutton']) { $smarty->assign('openPauseTag', $display->getOpenJukeboxActionTag('pause')); } if ($func['stopbutton']) { $smarty->assign('openStopTag', $display->getOpenJukeboxActionTag('stop')); } if ($func['prevbutton']) { $smarty->assign('openPrevTag', $display->getOpenJukeboxActionTag('previous')); } if ($func['nextbutton']) { $smarty->assign('openNextTag', $display->getOpenJukeboxActionTag('next')); } if ($func['shufflebutton']) { $smarty->assign('openShuffleTag', $display->getOpenJukeboxActionTag('random_play')); } if ($func['clearbutton']) { $smarty->assign('openClearTag', $display->getOpenJukeboxActionTag('clear')); } if ($func['volume']) { $smarty->assign('Volume', word('Volume:')); $smarty->assign('volumeSteps', range(0, 100, 5)); $vol = $_SESSION['jz_jbvol-' . $_SESSION['jb_id']]; if (!isset($vol) || !is_numeric($vol)) { $vol = 0; } $smarty->assign('currentVolume', $vol); } if ($func['addtype']) { /* how to add media */ $smarty->assign('whereAdd', word('Add media:')); function jbHREF($type) { return "javascript:sendJukeboxRequest('addwhere','{$type}');"; } $set = array(); $set[] = array('href' => jbHREF('current'), 'label' => 'After current track', 'selected' => $_SESSION['jb-addtype'] == "current"); $set[] = array('href' => jbHREF('begin'), 'label' => 'At beginning of playlist', 'selected' => $_SESSION['jb-addtype'] == "begin"); $set[] = array('href' => jbHREF('end'), 'label' => 'At end of playlist', 'selected' => $_SESSION['jb-addtype'] == "end"); $set[] = array('href' => jbHREF('replace'), 'label' => 'Replace current playlist', 'selected' => $_SESSION['jb-addtype'] == "replace"); $smarty->assign('addTypes', $set); } } jzTemplate($smarty, 'jukebox'); }
/** * Displays the random albums block * @author Ross Carlson * @version 12/22/04 * @since 12/22/04 * @param object $node the node that we are looking at * @param string $level The level we are looking at, like a subartist */ function randomAlbums(&$node, $level = "", $valArray = false) { global $random_albums, $random_per_slot, $random_rate, $row_colors, $root_dir, $jzUSER, $show_album_art, $random_art_size; // Should we be here???? if ($random_albums == "0" or $show_album_art == "false") { return; } // Let's setup the new display object $display =& new jzDisplay(); // Let's make sure they didn't pass the data already if ($valArray) { $artArray = $valArray; } else { // Now let's get a random amount of albums with album art $artArray = $node->getSubNodes("nodes", distanceTo("album", $node), true, $random_albums * $random_per_slot, true); } // Now let's see how much we got back and make sure we just shouldn't return if (count($artArray) == 0) { return; } // Now let's display the images ?> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> <?php // Now let's figure out how wide to make the colums if ($random_albums * $random_per_slot > count($artArray)) { // Now we've got to figure out how many we've got $numArt = count($artArray); if ($numArt > $random_albums) { $random_per_slot = round(count($artArray) / $random_albums - 0.49, 0); } else { $random_albums = count($artArray); $random_per_slot = 1; } } $colWidth = 100 / $random_albums; $c = 1; while ($c < $random_albums + 1) { echo '<td align="center" valign="middle" width="' . $colWidth . '">'; echo '<div id="div' . $c . '"></div>'; echo '</td>'; $c++; } ?> </tr> </table> <?php // Now let's add the Javascript for the rotations ?> <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"><!--\ //you may add your image file or text below $c=1; // Now let's create the variables <?php $c = 1; while ($c < $random_albums + 1) { echo "var imgItem" . $c . "=new Array()" . "\n"; $c++; } // Now let's build the first array with ALL the data so we can break it up later $c = 0; for ($i = 0; $i < count($artArray); $i++) { $albumName_long = $artArray[$i]->getName(); $albumName = returnItemShortName($artArray[$i]->getName(), 12); $albumLink = str_replace('"', "\\\"", $display->link($artArray[$i], $albumName, word("Browse") . ": " . $albumName_long, "jz_random_art_block", true)); $artist = $artArray[$i]->getNaturalParent(); $artistName_long = $artist->getName(); $artistName = returnItemShortName($artist->getName(), 12); $artistLink = str_replace('"', "\\\"", $display->link($artist, $artistName, word("Browse") . ": " . $artistName_long, "jz_random_art_block", true)); $artsize = explode("x", $random_art_size); $imgSrc = str_replace('"', "'", $display->returnImage($artArray[$i]->getMainArt($random_art_size), $artArray[$i]->getName(), $artsize[0], $artsize[1], "fixed")); $item_link = str_replace('"', "'", $display->link($artArray[$i], $imgSrc, $albumName_long, "jz_random_art_block", true)); // Now, can they stream? if ($jzUSER->getSetting('stream')) { $playLink = str_replace('"', "\\\"", $display->playLink($artArray[$i], word("Play"), word("Play") . ": " . $albumName_long, "jz_random_art_block", true)); $randLink = str_replace('"', "\\\"", $display->playLink($artArray[$i], word("Play Random"), word("Play Random") . ": " . $albumName_long, "jz_random_art_block", true, true)); $dispLink = $playLink . " - " . $randLink; } else { $dispLink = ""; } // Let's make sure they aren'te view only $arrayVar = "<center>" . $artistLink . "<br>" . $albumLink . "<br>" . $item_link; if ($jzUSER->getSetting('stream')) { $arrayVar .= "<br>" . $dispLink . "</center>"; } $fullArray[] = $arrayVar; } // Now we need to get the different arrays $c = 1; $start = 0; while ($c < $random_albums + 1) { $dataArray = array_slice($fullArray, $start, $random_per_slot); for ($ctr = 0; $ctr < count($dataArray); $ctr++) { echo "imgItem" . $c . "[" . $ctr . "]=\"" . $dataArray[$ctr] . '"' . "\n"; } // Now let's move on $start = $start + $random_per_slot; $c++; } // Now let's create the functions $c = 1; while ($c < $random_albums + 1) { ?> var current<?php echo $c; ?> =0 <?php $c++; } $c = 1; while ($c < $random_albums + 1) { ?> var ns6=document.getElementById&&!document.all function changeItem<?php echo $c; ?> (){ if(document.layers){ document.layer1.document.write(imgItem<?php echo $c; ?> [current<?php echo $c; ?> ]) document.layer1.document.close() } if(ns6)document.getElementById("div<?php echo $c; ?> ").innerHTML=imgItem<?php echo $c; ?> [current<?php echo $c; ?> ] { if(document.all){ div<?php echo $c; ?> .innerHTML=imgItem<?php echo $c; ?> [current<?php echo $c; ?> ] } } if (current<?php echo $c; ?> ==<?php echo $random_per_slot - 1; ?> ) current<?php echo $c; ?> =0 else current<?php echo $c; ?> ++ <?php if ($random_per_slot != 1) { ?> setTimeout("changeItem<?php echo $c; ?> ()",<?php echo $random_rate; ?> ) <?php } ?> } <?php $c++; } $c = 1; while ($c < $random_albums + 1) { ?> changeItem<?php echo $c; ?> (); <?php $c++; } ?> //--> </script> <?php }
if ($_GET['random_play_genre'] != "") { writeLogData('playback', "generated random playlist of " . $_GET['random_play_number'] . " tracks from genre '" . $_GET['random_play_genre'] . "' in {$timer} seconds."); } else { writeLogData('playback', "generated random playlist of " . $_GET['random_play_number'] . " tracks in {$timer} seconds."); } $pl->play(); exit; break; case "download": writeLogData("messages", "Index: Beginning a file download for: " . $_GET['jz_path']); //while (@ob_end_flush()); if ($_GET['type'] == "track" && $single_download_mode == "raw") { $el =& new jzMediaTrack($_GET['jz_path']); if (!checkStreamLimit($el)) { // TODO: AJAX this so we don't come to a page, but get a Javascript alert. echo word('Sorry, you have reached your download limit.'); exit; } // Are they downloading something resampled? if (stristr($_GET['jz_path'], "data/resample")) { $name = $el->getPath(); $name = $name[sizeof($name) - 1]; sendMedia($_GET['jz_path'], $name, $resample, true); } else { $el->increaseDownloadCount(); $name = $el->getPath(); $name = $name[sizeof($name) - 1]; sendMedia($el->getFileName("host"), $name, $resample, true); } exit; } else {
<?php if (!defined(JZ_SECURE_ACCESS)) { die('Security breach detected.'); } /** * Displays the quick box to add an item to favorites * * @author Ross Carlson * @since 12.17.05 * @version 12.17.05 * @param $path The node that we are viewing **/ global $include_path, $jzUSER; $node = new jzMediaNode($path); $display = new jzDisplay(); $be = new jzBackend(); // Let's start the page header $this->displayPageTop("", word("Adding to Favorites")); $this->openBlock(); echo word("Adding") . ": " . $node->getName(); // Now let's add it $this->closeBlock();
<?php if (!defined(JZ_SECURE_ACCESS)) { die('Security breach detected.'); } /** * Pulls the lyrics from a track and displays just them * * @author Ross Carlson * @since 04/08/05 * @version 04/08/05 * @param $node object The node we are viewing * **/ global $node; $track = new jzMediaTrack($node->getPath('String')); $meta = $track->getMeta(); $this->displayPageTop("", word("Lyrics for:") . " " . $meta['title']); $this->openBlock(); echo nl2br($meta['lyrics']); echo '<br><br><center>'; $this->closeButton(); $this->closeBlock();
?> (128kbps)</option> <option value="192"><?php echo word("Good quality"); ?> (192kbps)</option> <option value="320"><?php echo word("Highest quality"); ?> (320kbps)</option> </select> </td> </tr> </table> <br><br> <input type="submit" name="edit_download_tc_file" value="<?php echo word("Download"); ?> " class="jz_submit"> <?php } else { echo '<input type="hidden" name="edit_dlformat" value="native">'; echo '<input type="hidden" name="edit_dlbitrate" value="native">'; echo '<body onLoad="document.dlForm.submit();"></body>'; } ?> </form> <?php $this->closeBlock(); exit;
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 }
} // Now should we show this bar? $bcArray = explode("/", $jzPath); $url = array(); $smarty->assign('home_link', urlize($url)); $smarty->assign('word_home', word("Home")); $smarty->assign('open_folder', $include_path . 'style/images/folder.gif'); // open-folder is ugly // Now let's see if we need the breadcrumbs unset($bcArray[count($bcArray) - 1]); $path = ""; $crumbs = ""; foreach ($bcArray as $item) { if ($item != "") { $path .= "/" . $item; $arr['jz_path'] = $path; $crumbs .= ' / <a href="' . urlize($arr) . '">' . $item . '</a>'; } unset($arr); } $smarty->assign('bread_crumbs', $crumbs); $smarty->assign('artist_list', ""); if ($show_artist_list == "true") { $artist_list = word("Artists") . ": "; $artist_list .= '<form action="' . $this_page . '" method="post">'; $artist_list .= $display->hiddenPageVars(true); $artist_list .= $display->dropdown("artist", true, "jz_path", false, true); $artist_list .= '</form>'; $smarty->assign('artist_list', $artist_list); } jzTemplate($smarty, "browse-bar");
function download() { global $include_path; include_once $include_path . 'lib/jzcomp.lib.php'; include_once $include_path . 'lib/general.lib.php'; $pl = $this; if ($pl->getPlType() == "dynamic") { $pl->handleRules(); } $list = $pl->getList(); if (sizeof($list) == 0) { return; } // Can we download it? if (!checkStreamLimit($list)) { echo word('Sorry, you have reached your download limit.'); exit; } foreach ($list as $el) { $el->increaseDownloadCount(); } $pl->flatten(); $list = $pl->getList(); $i = 0; $files = array(); $m3u = ""; $oldPath = ""; $onepath = true; foreach ($list as $track) { $files[$i] = $track->getFileName("host"); // Let's also create the m3u playlist for all this $tArr = explode("/", $files[$i]); $m3u .= "./" . $tArr[count($tArr) - 1] . "\n"; $i++; // Now let's get the path and make sure we only see 1 unique path // If we see only one path we'll add art IF we can $pArr = $track->getPath(); unset($pArr[count($pArr) - 1]); $path = implode("/", $pArr); if ($path != $oldPath and $oldPath != "") { $onepath = false; } else { $oldPath = $path; } } $name = $this->getName(); if ($name === false || $name == "") { $name = "Playlist"; } // Now should we add art? if ($onepath) { // Ok, let's create the node so we can get the art $artNode = new jzMediaNode($oldPath); if ($artNode->getMainArt() != "") { $i++; $files[$i] = $artNode->getMainArt(); } } // Silly to send a 1 element playlist if (sizeof($files) > 1) { // Now let's write that to the temp dir $fileName = $include_path . "temp/playlist.m3u"; $handle = @fopen($fileName, "w"); @fwrite($handle, $m3u); @fclose($handle); $files[$i + 1] = $fileName; } // Now let's send it sendFileBundle($files, $name); }
/** * Displays the random albums block * @author Ross Carlson * @version 12/22/04 * @since 12/22/04 * @param object $node the node that we are looking at * @param string $level The level we are looking at, like a subartist */ function slickRandomAlbums(&$node, $level = "") { global $show_album_art, $random_albums, $random_per_slot, $random_albums, $random_per_slot, $random_rate, $row_colors, $root_dir, $jzUSER, $show_album_art, $random_art_size; // Should we show this? if ($show_album_art == "false") { return; } if ($_GET['action'] == "viewallart") { return; } // Now let's get a random amount of albums with album art $artArray = $node->getSubNodes("nodes", distanceTo("album", $node), true, $random_albums * $random_per_slot, true); if (count($artArray) == 0) { return; } $title = word("Random Albums"); if ($node->getName() != "") { $title = word("Random Albums") . " :: " . $node->getName(); } $url_array = array(); $url_array['jz_path'] = $node->getPath("String"); $url_array['action'] = "viewallart"; $showLink = '<a href="' . urlize($url_array) . '">' . word("View All Art") . '</a> '; // Should we be here???? if ($random_albums == "0" or $show_album_art == "false") { return; } // Let's setup the new display object $display =& new jzDisplay(); /* // WTF is this doing here? (BJD 6/21/06) // Let's make sure they didn't pass the data already if ($valArray){ $artArray = $valArray; } else { // Now let's get a random amount of albums with album art $artArray = $node->getSubNodes("nodes",distanceTo("album",$node),true,$random_albums*$random_per_slot,true); } // Now let's see how much we got back and make sure we just shouldn't return if (count($artArray) == 0){ return; } */ // Let's startup Smarty $smarty = smartySetup(); $smarty->assign('title', $title); $smarty->assign('showLink', $showLink); // Now let's display the template $smarty->display(SMARTY_ROOT . 'templates/slick/block-random-albums.tpl'); // Now let's add the Javascript for the rotations ?> <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"><!--\ //you may add your image file or text below $c=1; // Now let's create the variables <?php $c = 1; while ($c < $random_albums + 1) { echo "var imgItem" . $c . "=new Array()" . "\n"; $c++; } // Now let's build the first array with ALL the data so we can break it up later $c = 0; for ($i = 0; $i < count($artArray); $i++) { $albumName_long = $artArray[$i]->getName(); $albumName = returnItemShortName($albumName_long, 12); $albumLink = str_replace('"', "\\\"", $display->link($artArray[$i], $albumName, word("Browse") . ": " . $albumName_long, "jz_random_art_block", true)); $artist = $artArray[$i]->getNaturalParent(); $artistName_long = $artist->getName(); $artistName = returnItemShortName($artistName_long, 12); $artistLink = str_replace('"', "\\\"", $display->link($artist, $artistName, word("Browse") . ": " . $artistName_long, "jz_random_art_block", true)); $artsize = explode("x", $random_art_size); $art = $artArray[$i]->getMainArt($random_art_size); $imgSrc = str_replace('"', "'", $display->returnImage($art, $artistName_long, $artsize[0], $artsize[1], "fixed")); $item_link = str_replace('"', "'", $display->link($artArray[$i], $imgSrc, $albumName_long, "jz_random_art_block", true)); // Now, can they stream? if ($jzUSER->getSetting('stream')) { $playLink = str_replace('"', "\\\"", $display->playLink($artArray[$i], word("Play"), word("Play") . ": " . $albumName_long, "jz_random_art_block", true)); $randLink = str_replace('"', "\\\"", $display->playLink($artArray[$i], word("Play Random"), word("Play Random") . ": " . $albumName_long, "jz_random_art_block", true, true)); $dispLink = $playLink . " - " . $randLink; } else { $dispLink = ""; } // Let's make sure they aren'te view only $arrayVar = "<center>" . $artistLink . "<br>" . $albumLink . "<br>" . $item_link; if ($jzUSER->getSetting('stream')) { $arrayVar .= "<br>" . $dispLink . "</center>"; } $fullArray[] = $arrayVar; } // Now we need to get the different arrays $c = 1; $start = 0; while ($c < $random_albums + 1) { $dataArray = array_slice($fullArray, $start, $random_per_slot); for ($ctr = 0; $ctr < count($dataArray); $ctr++) { echo "imgItem" . $c . "[" . $ctr . "]=\"" . $dataArray[$ctr] . '"' . "\n"; } // Now let's move on $start = $start + $random_per_slot; $c++; } // Now let's create the functions $c = 1; while ($c < $random_albums + 1) { ?> var current<?php echo $c; ?> =0 <?php $c++; } $c = 1; while ($c < $random_albums + 1) { ?> var ns6=document.getElementById&&!document.all function changeItem<?php echo $c; ?> (){ if(document.layers){ document.layer1.document.write(imgItem<?php echo $c; ?> [current<?php echo $c; ?> ]) document.layer1.document.close() } if(ns6)document.getElementById("div<?php echo $c; ?> ").innerHTML=imgItem<?php echo $c; ?> [current<?php echo $c; ?> ] { if(document.all){ div<?php echo $c; ?> .innerHTML=imgItem<?php echo $c; ?> [current<?php echo $c; ?> ] } } if (current<?php echo $c; ?> ==<?php echo $random_per_slot - 1; ?> ) current<?php echo $c; ?> =0 else current<?php echo $c; ?> ++ <?php if ($random_per_slot != 1) { ?> setTimeout("changeItem<?php echo $c; ?> ()",<?php echo $random_rate; ?> ) <?php } ?> } <?php $c++; } $c = 1; while ($c < $random_albums + 1) { ?> changeItem<?php echo $c; ?> (); <?php $c++; } ?> //--> </script> <?php }
<?php if (!defined(JZ_SECURE_ACCESS)) { die('Security breach detected.'); } /** * Adds the selected node to the featured list * * @author Ross Carlson * @version 01/19/05 * @since 01/19/05 * @param $node The node that we are viewing */ global $node; // First let's display the top of the page and open the main block $this->displayPageTop("", word("Adding to featured") . "<br>" . $node->getName()); $this->openBlock(); // Now let's add this puppy $node->addFeatured(); // Let's display status echo "<br>" . word("Add complete!"); // Now let's close out $this->closeBlock(); flushDisplay(); sleep(3); $this->closeWindow(true);
echo word("Track Number"); ?> </td> <td> <?php echo word("Filesystem Data"); ?> <br> </td> </tr> <tr> <td valign="top"> <input type="checkbox" checked name="reAlbumArt"> <?php echo word("Album Art"); ?> </td> <td> <?php echo word("Filesystem Data"); ?> <br> </td> </tr> </table> <br><center><input type="submit" name="updateTags" value="<?php echo word("Retag Tracks"); ?> " class="jz_submit"></center> </form> <?php $this->closeBlock();
function pageTop($title = false, $endBreak = "true", $ratingItem = "") { global $this_page, $img_home, $quick_list_truncate, $img_random_play, $cms_mode, $random_play_amounts, $directory_level, $img_up_arrow, $header_drops, $genre_drop, $artist_drop, $album_drop, $quick_drop, $root_dir, $web_root, $song_drop, $audio_types, $video_types, $media_dir, $img_more, $img_random_play_dis, $url_seperator, $help_access, $jukebox, $jukebox_num, $disable_random, $jz_lang_file, $show_slimzora, $img_slim_pop, $allow_resample, $resampleRates, $default_random_type, $default_random_count, $display_previous, $echocloud, $display_recommended, $enable_requests, $enable_ratings, $enable_search, $enable_meta_search, $user_tracking_display, $user_tracking_admin_only, $site_title, $node, $jzUSER, $img_play, $img_playlist, $jinzora_skin, $include_path, $img_play_dis, $img_random_play_dis, $img_download_dis, $img_add_dis, $img_playlist_dis, $allow_filesystem_modify, $disable_leftbar, $allow_interface_choice, $allow_style_choice, $allow_language_choice, $show_now_streaming, $show_who_is_where, $show_user_browsing, $jukebox_height, $backend, $config_version, $allow_resample, $jukebox_display; // First let's include the settings for Netjuke include_once $include_path . "frontend/frontends/netjuke/settings.php"; // Let's see if they wanted to pass a title if (!$title) { $title = $site_title; } if (!isset($_GET['jz_path'])) { $_GET['jz_path'] = ""; } // Let's setup our objects $root =& new jzMediaNode(); $display =& new jzDisplay(); $blocks = new jzBlocks(); // First let's see if our session vars are set for the number of items if (!isset($_SESSION['jz_num_genres'])) { $_SESSION['jz_num_genres'] = $root->getSubNodeCount("nodes", distanceTo("genre")); } if (!isset($_SESSION['jz_num_artists'])) { $_SESSION['jz_num_artists'] = $root->getSubNodeCount("nodes", distanceTo("artist")); } if (!isset($_SESSION['jz_num_albums'])) { $_SESSION['jz_num_albums'] = $root->getSubNodeCount("nodes", distanceTo("album")); } if (!isset($_SESSION['jz_num_tracks'])) { $_SESSION['jz_num_tracks'] = $root->getSubNodeCount("tracks", -1); } ?> <a name="pageTop"></a> <table width="100%" cellpadding="5" cellspacing="0" border="0"> <tr> <td> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td align="center" class="jz_block_td"> <?php echo '<a href="' . urlize(array()) . '">'; echo '<strong>BROWSE</strong>'; echo '</a>'; ?> </td> <td align="center" class="jz_block_td"> <strong> <?php $urla = array(); $urla['action'] = "powersearch"; echo "<a href=\"" . urlize($urla) . "\">SEARCH</a>"; ?> </strong> </td> <td align="center" class="jz_block_td"> <strong> <?php $display->randomPlayButton($node, false, word("RANDOM")); ?> </strong> </td> <td align="center" class="jz_block_td"> <strong><?php $urla['action'] = "popup"; $urla['ptype'] = "playlistedit"; echo "<a href=\"" . urlize($urla) . "\" onclick=\"openPopup(this, 550, 600); return false;\">PLAYLISTS</a>"; ?> </strong> </td> <td align="center" class="jz_block_td"> <strong><?php $display->popupLink("preferences", "PREFERENCES"); ?> </strong> </td> <td align="center" class="jz_block_td"> <strong><?php $display->loginLink("LOGIN", "LOGOUT"); ?> </strong> </td> </tr> </table> <br> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <?php // Can this user powersearch? if ($jzUSER->getSetting('powersearch')) { ?> <td align="center" valign="top"> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td class="jz_block_td"> <?php $url_search = array(); $url_search['action'] = "powersearch"; echo '<a href="' . urlize($url_search) . '">'; ?> <strong>QUICK SEARCH</strong></a> </td> </tr> <tr> <?php $onSubmit = ""; if ($jukebox == "true" && !defined('NO_AJAX_JUKEBOX')) { $onSubmit = 'onSubmit="return searchKeywords(this,\'' . htmlentities($this_page) . '\');"'; } if ($cms_mode == "true") { $method = "GET"; } else { $method = "POST"; } ?> <td class="jz_nj_block_body" align="center"> <form action="<?php echo $this_page; ?> " name="searchForm" method="<?php echo $method; ?> " <?php echo $onSubmit; ?> > <?php foreach (getURLVars($this_page) as $key => $val) { echo '<input type="hidden" name="' . htmlentities($key) . '" value="' . htmlentities($val) . '">'; } ?> <input type="text" name="search_query" class="jz_input" style="width:150px; font-size:10px; margin-bottom:3px;"> <br> <select class="jz_select" name="search_type" style="width:85px"> <option value="ALL"><?php echo word("All Media"); ?> </option> <?php if (distanceTo("artist") !== false) { echo '<option value="artists">' . word("Artists") . '</option>' . "\n"; } if (distanceTo("album") !== false) { echo '<option value="albums">' . word("Albums") . '</option>' . "\n"; } ?> <option value="tracks"><?php echo word("Tracks"); ?> </option> <option value="lyrics"><?php echo word("Lyrics"); ?> </option> </select> <input type="hidden" name="doSearch" value="true"> <input type="submit" class="jz_submit" name="doSearch" value="Go"> </form> </td> </tr> </table> </td> <?php // This ends the if they can powersearch statement } ?> <?php // Are they resampling? if ($display->wantResampleDropdown($node)) { $display->displayResampleDropdown($node); // PROBLEM: Currently can't use small jukebox and resampling. } if (checkPermission($jzUSER, "jukebox_queue") && ($jukebox_display == "small" or $jukebox_display == "minimal")) { ?> <td align="center"> </td> <td align="center" valign="top"> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td class="jz_block_td" width="100%" nowrap> <strong>PLAYBACK</strong> </td> </tr> <tr> <td class="jz_nj_block_body" align="left" width="1%" nowrap><div id="smallJukebox"> <?php $blocks->smallJukebox(false, "top"); ?> </div></td> </tr> </table> </td> <?php } ?> <td align="center"> </td> <td align="center" valign="top"> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td class="jz_block_td" colspan="3" width="100%" nowrap> <strong>CONTENT SUMMARY</strong> </td> </tr> <?php // Let's get the stats if (!isset($_SESSION['jz_total_tracks'])) { $root = new jzMediaNode(); $stats = $root->getStats(); $_SESSION['jz_total_tracks'] = $stats['total_tracks']; $_SESSION['jz_total_genres'] = $stats['total_genres']; $_SESSION['jz_total_artists'] = $stats['total_artists']; $_SESSION['jz_total_albums'] = $stats['total_albums']; $_SESSION['jz_total_size'] = $stats['total_size_str']; $_SESSION['jz_total_length'] = $stats['total_length']; } ?> <tr> <td class="jz_nj_block_body" align="center" width="1%" nowrap> <?php echo number_format($_SESSION['jz_total_tracks']); ?> Tracks </td> <td class="jz_nj_block_body" align="center" width="1%" nowrap> <?php echo number_format($_SESSION['jz_total_artists']); ?> Artists </td> <td class="jz_nj_block_body" align="center" width="1%" nowrap> <?php echo formatTime($_SESSION['jz_total_length']); ?> </td> </tr> <tr> <td class="jz_nj_block_body" align="center" width="1%" nowrap> <?php echo number_format($_SESSION['jz_total_albums']); ?> Albums </td> <td class="jz_nj_block_body" align="center" width="1%" nowrap> <?php echo number_format($_SESSION['jz_total_genres']); ?> Genres </td> <td class="jz_nj_block_body" align="center" width="1%" nowrap> <?php echo $_SESSION['jz_total_size']; ?> </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>ARTISTS A-Z <?php echo "(" . $_SESSION['jz_num_artists'] . ")"; ?> </strong> - <?php $urlar = array(); //$urlar['jz_path'] = $node->getPath("String"); $urlar['jz_level'] = distanceTo("artist"); $urlar['jz_letter'] = "*"; echo "<a href=\"" . urlize($urlar) . "\">" . word("All") . "</a>"; ?> </td> </tr> <tr> <td class="jz_nj_block_body" align="center"> <?php for ($let = 'A'; $let != 'Z'; $let++) { $urlar['jz_letter'] = $let; echo "<a href=\"" . urlize($urlar) . "\">" . $let . "</a> "; if ($let == 'L' or $let == 'X') { echo "<br>"; } } $urlar['jz_letter'] = "Z"; echo "<a href=\"" . urlize($urlar) . "\">Z</a> "; for ($let = '1'; $let != '10'; $let++) { $urlar['jz_letter'] = $let; echo "<a href=\"" . urlize($urlar) . "\">" . $let . "</a> "; } $urlar['jz_letter'] = "*"; echo "<a href=\"" . urlize($urlar) . "\">0</a> "; ?> </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>ALBUMS A-Z <?php echo "(" . $_SESSION['jz_num_albums'] . ")"; ?> </strong> - <?php $urlar['jz_level'] = distanceTo("album"); $urla['jz_letter'] = "*"; echo "<a href=\"" . urlize($urlar) . "\">" . word("All") . "</a>"; ?> </td> </tr> <tr> <td class="jz_nj_block_body" align="center"> <?php for ($let = 'A'; $let != 'Z'; $let++) { $urlar['jz_letter'] = $let; echo "<a href=\"" . urlize($urlar) . "\">" . $let . "</a> "; if ($let == 'L' or $let == 'X') { echo "<br>"; } } $urlar['jz_letter'] = "Z"; echo "<a href=\"" . urlize($urlar) . "\">Z</a> "; for ($let = '1'; $let != '10'; $let++) { $urlar['jz_letter'] = $let; echo "<a href=\"" . urlize($urlar) . "\">" . $let . "</a> "; } $urlar['jz_letter'] = "0"; echo "<a href=\"" . urlize($urlar) . "\">0</a> "; ?> </td> </tr> </table> </td> </tr> </table> <?php // Are they in Jukebox mode? if (checkPermission($jzUSER, "jukebox_queue") && $jukebox_display != "small" && $jukebox_display != "off") { ?> <br> <table width="100%" cellpadding="3" cellspacing="0" border="0"> <tr> <td align="center" class="jz_block_td"> <div id="jukebox"> <?php include jzBlock('jukebox'); ?> </div> </td> </tr> </table> <?php } ?> </td> </tr> </table> <?php }
/* file: seek-action.php purpose: seek a work query by: petj * tip: use the search option in PHPMyAdmin in order to create the $sql * tip: don't use the php escape characters \. */ /* from input to query */ function word($what) { /* mysqli database connection */ require_once "db.php"; /* headline printed */ print "<h2>Searching: {$what}</h3>"; /* format the sql */ $sql = "SELECT * FROM `sakila`.`actor` \n\t\t\tWHERE (\n\t\t\tCONVERT(`actor_id` USING utf8) LIKE '%" . $what . "%' \n\t\t\tOR CONVERT(`first_name` USING utf8) LIKE '%" . $what . "%' \n\t\t\tOR CONVERT(`last_name` USING utf8) LIKE '%" . $what . "%' ) \n\t\t\tORDER BY `first_name`"; /* mysqli query */ $result = $mysqli->query($sql); // query /* loop out the result */ while ($row = $result->fetch_assoc()) { echo $row['first_name'] . " "; echo $row['last_name'] . '<br />'; } mysqli_close($mysqli); } // ends word /* Fire the function off if the OK button has been pressed */ if (isset($_GET['OK'])) { word($_GET['seek']); }
$jzService = new jzServices(); $jzService->loadService("metadata", "msnmusic"); $image = $jzService->getAlbumMetadata($node, false, "image"); if (strlen($image) != 0) { echo '<img src="' . $image . '" border="0"><br>'; echo $display->returnImageDimensions($image); echo '<br><br>'; echo '<input type="hidden" value="' . $image . '" name="edit_image_' . $i . '">'; echo '<input type="submit" name="edit_download_' . $i . '" value="' . word('Download') . '" class="jz_submit"><br><br><br>'; $i++; } flushdisplay(); // Now let's get a link from Musicbrainz unset($jzService); unset($image); $jzService = new jzServices(); $jzService->loadService("metadata", "musicbrainz"); $image = $jzService->getAlbumMetadata($node, false, "image"); if (strlen($image) != 0) { echo '<img src="' . $image . '" border="0"><br>'; echo $display->returnImageDimensions($image); echo '<br><br>'; echo '<input type="hidden" value="' . $image . '" name="edit_image_' . $i . '">'; echo '<input type="submit" name="edit_download_' . $i . '" value="' . word('Download') . '" class="jz_submit"><br><br><br>'; $i++; } flushdisplay(); echo "<br>"; $this->closeButton(); echo "</form></center>"; $this->closeBlock();
function edit ($file) { global $self, $directory, $editcols, $editrows, $apache, $htpasswd, $htaccess; html_header(); echo '<h2 style="margin-bottom: 3pt">' . html($file) . '</h2> <form action="' . $self . '?tool=Files" method="post"> <table class="dialog"> <tr> <td class="dialog"> <textarea name="content" cols="' . $editcols . '" rows="' . $editrows . '" WRAP="off">'; if (array_key_exists('content', $_POST)) { echo $_POST['content']; } else { $f = fopen($file, 'r'); while (!feof($f)) { echo html(fread($f, 8192)); } fclose($f); } if (!empty($_POST['user'])) { echo "\n" . $_POST['user'] . ':' . crypt($_POST['password']); } if (!empty($_POST['basic_auth'])) { if ($win) { $authfile = str_replace('\\', '/', $directory) . $htpasswd; } else { $authfile = $directory . $htpasswd; } echo "\nAuthType Basic\nAuthName "Restricted Directory"\n"; echo 'AuthUserFile "' . html($authfile) . ""\n"; echo 'Require valid-user'; } echo '</textarea> <hr /> '; if ($apache && basename($file) == $htpasswd) { echo ' ' . word('user') . ': <input type="text" name="user" /> ' . word('password') . ': <input type="password" name="password" /> <input type="submit" value="' . word('add') . '" /> <hr /> '; } if ($apache && basename($file) == $htaccess) { echo ' <input type="submit" name="basic_auth" value="' . word('add_basic_auth') . '" /> <hr /> '; } echo ' <input type="hidden" name="action" value="edit" /> <input type="hidden" name="file" value="' . html($file) . '" /> <input type="hidden" name="dir" value="' . html($directory) . '" /> <input type="reset" value="' . word('reset') . '" id="red_button" /> <input type="submit" name="save" value="' . word('save') . '" id="green_button" style="margin-left: 50px" /> </td> </tr> </table> <p><a href="' . $self . '?tool=Files&dir=' . urlencode($directory) . '">[ ' . word('back') . ' ]</a></p> </form> '; html_footer(); }
} // Ok, let's do it... echo "<b>" . word("Scanning") . ":</b>"; echo '<div id="importStatus"></div>'; ?> <script language="javascript"> d = document.getElementById("importStatus"); --> </SCRIPT> <?php set_time_limit(0); flushdisplay(); // Now how to scan? if ($_POST['edit_scan_where'] == "only") { $recursive = false; } else { $recursive = true; } // Let's scan... if (isset($_POST['edit_force_scan'])) { $force_scan = true; } else { $force_scan = false; } updateNodeCache($node, $recursive, true, $force_scan); echo "<br><br><b>" . word("Complete!") . "</b>"; $this->closeBlock(); flushdisplay(); // Now let's close out echo "<br><br><center>"; $this->closeButton();