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'); }
/** * Creates an RAM compliant playlist and returns it for playing * * @author Ross Carlson * @version 2/24/05 * @since 2/24/05 * @param $list The list of tracks to use when making the playlist * @param $return Returns the porperly formated list */ function SERVICE_CREATE_PLAYLIST_RAM($list) { global $allow_resample, $this_site, $root_dir, $web_root; // Let's start the list off right $content = ""; $list->flatten(); // Let's setup Smarty $smarty = smartySetup(); // Let's start the list off right $list->flatten(); $i = 0; foreach ($list->getList() as $track) { // Should we play this? if ((stristr($track->getPath("String"), ".lofi.") or stristr($track->getPath("String"), ".clip.")) and $_SESSION['jz_play_all_tracks'] != true) { continue; } // Let's get the meta $meta = $track->getMeta(); // Now let's figure out the full track name $trackn = $track->getFileName("user"); if (!stristr($trackn, "mediabroadcast.php")) { $track->increasePlayCount(); } $tArr[$i]['link'] = $trackn; $tArr[$i]['artist'] = $meta['artist']; $tArr[$i]['album'] = $meta['album']; $tArr[$i]['genre'] = $meta['genre']; $tArr[$i]['track'] = $meta['title']; $tArr[$i]['length'] = $meta['length']; $tArr[$i]['year'] = $meta['year']; $tArr[$i]['i'] = $i + 1; $i++; } unset($_SESSION['jz_play_all_tracks']); $smarty->assign('this_site', $this_site); $smarty->assign('root_dir', $root_dir); $smarty->assign('tracks', $tArr); $smarty->assign('total', count($tArr)); // Now let's include the template $smarty->display(SMARTY_ROOT . 'templates/playlists/ram.tpl'); return; // Now let's loop throught the items to create the list foreach ($list->getList() as $track) { // Should we play this? if ((stristr($track->getPath("String"), ".lofi.") or stristr($track->getPath("String"), ".clip.")) and $_SESSION['jz_play_all_tracks'] != true) { continue; } $meta = $track->getMeta(); // Now let's figure out the full track name $trackn = $track->getFileName("user"); if (!stristr($trackn, "mediabroadcast.php")) { $track->increasePlayCount(); } // Now let's set the URL $content .= $trackn . '&clipinfo="title=' . $meta['title'] . '|artist name=' . $meta['artist'] . '|album name=' . $meta['album'] . '|genre=' . $meta['genre'] . '|year=' . $meta['year'] . '"&mode=normal' . "\n"; } unset($_SESSION['jz_play_all_tracks']); // Now let's return return $content; }
function standardPage(&$node) { global $show_artist_alpha, $truncate_length, $sort_by_year, $jzSERVICES; // Let's setup the objects $blocks =& new jzBlocks(); $display =& new jzDisplay(); $smarty = smartySetup(); $itemArray = getCurNodeList(); $smarty->assign("nodes", $itemArray); // Now are there any tracks? // Probably handle this differently: // change getCurNodeList to getCurMediaList. $tracks = $node->getSubNodes("tracks"); if (count($tracks) != 0) { $smary->assign("tracks", array()); } $smarty->assign("playerURL", urlize(array("frame" => "player"))); $smarty->assign("bodyURL", urlize(array("frame" => "body"))); // OUTPUT HTML // Is this our first pageview? if ((!isset($_GET['refview']) || $_GET['refview'] != $this->name) && !isset($_GET['frame'])) { $display->preheader(); $smarty->assign("playerHeight", $jzSERVICES->returnPlayerHeight()); jzTemplate($smarty, "page"); } else { if (isset($_GET['frame']) && $_GET['frame'] == "player") { $display->preheader(); jzTemplate($smarty, "player"); } else { $display->preheader(); jzTemplate($smarty, "body"); } } }
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 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(); $smarty = smartySetup(); // Let's display the header $this->pageTop($node); include jzBlock('standard-page'); // Now are there any tracks? if (isset($_GET['jz_letter'])) { $root = new jzMediaNode(); $tracks = array(); } else { $tracks = $node->getSubNodes("tracks"); } if (count($tracks) != 0) { $blocks->trackTable($tracks); } include jzBlock('playlist-bar'); // Now let's close out $this->footer($node); }
/** * Creates an ASX compliant playlist and returns it for playing * * @author Ross Carlson * @version 2/24/05 * @since 2/24/05 * @param $list The list of tracks to use when making the playlist * @param $return Returns the porperly formated list */ function SERVICE_CREATE_PLAYLIST_ASX($list) { global $allow_resample, $this_site, $root_dir, $web_root, $asx_show_trackdetail; // Let's setup Smarty $smarty = smartySetup(); // This playlist type supports the following media types: $supported = "asf|wma|wmv|wm|asx|wax|wvx|wpl|dvr-ms|wmd|avi|mpg|mpeg|m1v|mp2|mp3|mpa|mpe|mpv2|m3u|ogg|mid|midi|rmi|aif|aifc|aiff|au|snd|wav|ivf|flac|mpc|wv|m4a|"; // Let's define our variables $i = 0; foreach ($list->getList() as $track) { // Should we play this? if ((stristr($track->getPath("String"), ".lofi.") or stristr($track->getPath("String"), ".clip.")) and $_SESSION['jz_play_all_tracks'] != true) { continue; } // Now let's get the extension to be sure it can be played $pArr = explode("/", $track->getPath("String")); $eArr = explode(".", $pArr[count($pArr) - 1]); $ext = $eArr[count($eArr) - 1]; if (!stristr($supported, $ext . "|")) { continue; } // Let's get the meta $meta = $track->getMeta(); // Now let's figure out the full track name $trackn = $track->getFileName("user"); if (!stristr($trackn, "mediabroadcast.php")) { $track->increasePlayCount(); } $tArr[$i]['link'] = $trackn; if ($meta['artist'] != "" and $meta['artist'] != "-") { $tArr[$i]['artist'] = $meta['artist'] . " - "; } else { $tArr[$i]['artist'] = ""; } $tArr[$i]['album'] = $meta['album']; $tArr[$i]['genre'] = $meta['genre']; $tArr[$i]['track'] = $meta['title']; $tArr[$i]['length'] = $meta['length']; $tArr[$i]['path'] = rawurlencode($track->getPath("String")); $tArr[$i]['url'] = $this_site . $root_dir; $i++; } $smarty->assign('this_site', $this_site); $smarty->assign('root_dir', $root_dir); $smarty->assign('tracks', $tArr); $smarty->assign('totalTracks', $i); if (!isset($asx_show_trackdetail)) { $asx_show_trackdetail = "true"; } $smarty->assign('asx_show_trackdetail', $asx_show_trackdetail); // Now let's include the template $smarty->display(SMARTY_ROOT . 'templates/playlists/asx.tpl'); }
function drawPage(&$node) { global $album_name_truncate, $row_colors, $num_other_albums, $jzUSER, $show_similar, $show_radio, $jzSERVICES; // Let's setup the new display object $display =& new jzDisplay(); $blocks =& new jzBlocks(); $fe =& new jzFrontend(); $smarty = smartySetup(); // Now should we show this colum $parent = $node->getAncestor("artist"); if ($parent !== false) { $parentArt = $parent->getMainArt(); $parentDesc = $parent->getDescription(); $desc = $node->getDescription(); $art = $node->getMainArt(); } $smarty->assign('show_profile_col', false); if ($parentArt != false or $parentDesc != "" or $desc != "" or $art != false) { $smarty->assign('show_profile_col', true); } $smarty->assign('show_other_albums', false); if ($num_other_albums > 0) { $smarty->assign('show_other_albums', true); } $smarty->assign('show_right_col', false); // Do they want either of these? if ($show_similar == "true" or $show_radio == "true") { $smarty->assign('show_right_col', true); $parent = $node->getAncestor('artist'); $simArray = $jzSERVICES->getSimilar($parent); $simArray = seperateSimilar($simArray); $smarty->assign('show_similar', false); if (sizeof($simArray['matches']) != 0) { $smarty->assign('show_similar', true); } } $smarty->assign('show_radio', $show_radio); $smarty->assign('show_similar', $show_similar); // Now let's display the template //$smarty->display(SMARTY_ROOT. 'templates/slick/header.tpl'); $smarty->display(SMARTY_ROOT . 'templates/slick/album.tpl'); }
/** * Creates an M3U compliant playlist and returns it for playing * * @author Ross Carlson * @version 2/24/05 * @since 2/24/05 * @param $list The list of tracks to use when making the playlist * @param $return Returns the porperly formated list */ function SERVICE_CREATE_PLAYLIST_M3U($list) { global $allow_resample, $web_root, $root_dir, $this_site; // Let's setup Smarty $smarty = smartySetup(); // Let's start the list off right $list->flatten(); $i = 0; foreach ($list->getList() as $track) { // Should we play this? if ((stristr($track->getPath("String"), ".lofi.") or stristr($track->getPath("String"), ".clip.")) and $_SESSION['jz_play_all_tracks'] != true) { continue; } // Now let's get the extension to be sure it can be played $pArr = explode("/", $track->getPath("String")); $eArr = explode(".", $pArr[count($pArr) - 1]); $ext = $eArr[count($eArr) - 1]; // Let's get the meta $meta = $track->getMeta(); // Now let's figure out the full track name $trackn = $track->getFileName("user"); if (!stristr($trackn, "mediabroadcast.php")) { $track->increasePlayCount(); } $tArr[$i]['link'] = $trackn; $tArr[$i]['artist'] = $meta['artist']; $tArr[$i]['album'] = $meta['album']; $tArr[$i]['genre'] = $meta['genre']; $tArr[$i]['track'] = $meta['title']; $tArr[$i]['length'] = $meta['length']; $i++; } unset($_SESSION['jz_play_all_tracks']); $smarty->assign('this_site', $this_site); $smarty->assign('root_dir', $root_dir); $smarty->assign('tracks', $tArr); // Now let's include the template $smarty->display(SMARTY_ROOT . 'templates/playlists/m3u.tpl'); }
/** * Draws the Jinzora similar albums block * * @author Ross Carlson * @version 01/11/05 * @since 01/11/05 * @param string $artist The artist that we are getting similar artist data from * @param bolean $limit Should we limit how many results we get back */ function similarAlbumBlock($element, $limit = false) { global $album_name_truncate, $jzSERVICES, $img_tiny_play, $img_tiny_play_dis, $jzUSER, $cms_mode; $display = new jzDisplay(); $element = $element->getAncestor("artist"); if ($element === false) { return; } // Ok, now we need to search Echocloud to get matches to this artist $simArray = $jzSERVICES->getSimilar($element); $simArray = seperateSimilar($simArray); if (sizeOf($simArray['matches']) == 0) { return; } // Let's setup Smarty $smarty = smartySetup(); $smarty->assign('title', word("Similar Albums")); $_SESSION['sim_limit'] = $limit; $smarty->display(SMARTY_ROOT . 'templates/general/similar-album.tpl'); }
/** * 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 }
} } // Last thing: we want to draw a standard page, since we did not previously exit. // TODO: check for specialty pages (search,playlistmanager,etc) // Let's count how many of everything we have if (!isset($_SESSION['jz_num_genres'])) { $root =& new jzMediaNode(); $_SESSION['jz_num_genres'] = $root->getSubNodeCount("nodes", distanceTo("genre")); $_SESSION['jz_num_artists'] = $root->getSubNodeCount("nodes", distanceTo("artist")); $_SESSION['jz_num_albums'] = $root->getSubNodeCount("nodes", distanceTo("album")); $_SESSION['jz_num_tracks'] = $root->getSubNodeCount("nodes", distanceTo("track")); } // The header file defines our drawPage function. $maindiv = isset($_GET['maindiv']) || isset($_POST['maindiv']) ? true : false; // Let's check for security $blocks = new jzBlocks(); if ($blocks->checkForSecure()) { $smarty = smartySetup(); $smarty->assign('path', getcwd()); // Now let's include the template $smarty->display(SMARTY_ROOT . 'templates/slick/security-warning.tpl'); exit; } if (isset($_SESSION['current_interface'])) { $_SESSION['ref_interface'] = $_SESSION['current_interface']; } else { $_SESSION['ref_interface'] = ""; } $_SESSION['current_interface'] = $fe->name; $_SESSION['jz_purge_file_cache'] = "false"; $fe->standardPage($node, $maindiv);
function pageTop($node) { global $img_home, $jinzora_skin, $root_dir, $css, $this_page, $cms_mode, $jzUSER, $include_path, $desc_truncate, $image_size, $jinzora_url, $image_dir, $jukebox, $jzSERVICES, $jukebox_display, $cms_mode, $show_artist_alpha, $show_artist_list, $allow_resample; // Let's setup our objects $display = new jzDisplay(); $blocks = new jzBlocks(); $smarty = smartySetup(); // Now let's make sure our Node is set and if not set one if (!is_object($node)) { $node = new jzMediaNode(); } // Let's include the settings file include_once $include_path . 'frontend/frontends/mediacenter/settings.php'; // Let's set some variables $smarty->assign('root_dir', $root_dir); // Ok, now let's include the first template $smarty->display(SMARTY_ROOT . 'templates/mediacenter/header.tpl'); exit; $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->display(SMARTY_ROOT . 'templates/mediacenter/header.tpl'); // Now let's see if we should show the jukebox iframe $smarty->assign('jukebox_queue', false); if (checkPermission($jzUSER, "jukebox_queue")) { $smarty->assign('jukebox_queue', true); if ($jukebox_display == "small" or $jukebox_display == "minimal") { $smarty->assign('jukebox_display', "small"); } else { $smarty->assign('jukebox_display', "full"); } } $smarty->display(SMARTY_ROOT . 'templates/mediacenter/jukebox.tpl'); // Let's show the news $siteNews = $blocks->siteNews($node); $smarty->assign('site_news', $siteNews); if ($siteNews != "") { $smarty->display(SMARTY_ROOT . 'templates/mediacenter/site-news.tpl'); } // Now do we have art or image or desc at the album level if ($node->getPType() == "album") { if (($art = $node->getMainArt($image_size . "x" . $image_size)) != false or ($desc = $node->getDescription()) != "") { $desc = $node->getDescription(); // Ok, let's display echo '<table width="100%" cellspacing="0" cellpadding="5">'; echo '<tr class="and_head1">'; echo '<td width="100%" align="left">'; // Let's display the name $artist = $node->getAncestor('artist'); echo "<strong>"; if ($artist !== false) { $display->link($artist, $artist->getName()); echo " - "; } echo $node->getName(); if (!isNothing($node->getYear())) { echo " (" . $node->getYear() . ")"; } echo '</strong><br>'; if ($art) { if ($desc) { $align = "left"; } else { $align = "center"; } $display->image($art, $node->getName(), $image_size, $image_size, "limit", false, false, $align, "4", "4"); } if ($cms_mode == "false") { echo '<div class="jz_artistDesc">'; } echo $display->returnShortName($desc, $desc_truncate); // Do we need the read more link? if (strlen($desc) > $desc_truncate) { $url_array = array(); $url_array['jz_path'] = $node->getPath("String"); $url_array['action'] = "popup"; $url_array['ptype'] = "readmore"; echo ' <a href="' . urlize($url_array) . '" onclick="openPopup(this, 450, 450); return false;">...read more</a>'; } if ($cms_mode == "false") { echo '</div>'; } echo '</td></tr></table>'; } } // Can this user powersearch? $on = true; if ($jzUSER->getSetting('powersearch') and $on == true) { if ($cms_mode == "true") { $method = "GET"; } else { $method = "POST"; } ?> <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> <?php } ?> <?php if (isset($_POST['jz_path'])) { $jzPath = $_POST['jz_path']; } else { $jzPath = $_GET['jz_path']; } // Now should we show this bar? $bcArray = explode("/", $jzPath); ?> <table width="100%" cellspacing="0" cellpadding="5"> <tr class="and_head1"> <td width="50%" valign="middle"> <?php $url = array(); echo '<a href="' . urlize($url) . '"><img src="' . $image_dir . 'open-folder.gif" border="0"></a>'; // Now let's see if we need the breadcrumbs unset($bcArray[count($bcArray) - 1]); $path = ""; echo ' <a href="' . urlize($url) . '">' . word("Home") . '</a>'; foreach ($bcArray as $item) { if ($item != "") { $path .= "/" . $item; $arr['jz_path'] = $path; echo ' / <a href="' . urlize($arr) . '">' . $item . '</a>'; } unset($arr); } ?> </td> <td width="50%" valign="middle" align="right" nowrap="nowrap"> <?php if ($show_artist_list == "true") { ?> <?php echo word("Artist") . ": "; ?> <form action="<?php echo $this_page; ?> " method="post"> <?php $display->hiddenPageVars(); $display->dropdown("artist"); ?> </form> | <?php } ?> <?php echo word('Search:'); ?> <form action="<?php echo $this_page; ?> " method="<?php echo $method; ?> "> <?php foreach (getURLVars($this_page) as $key => $val) { echo '<input type="hidden" name="' . htmlentities($key) . '" value="' . htmlentities($val) . '">'; } ?> <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="text" name="search_query" class="jz_input" style="width:125px; font-size:10px "> <input type="hidden" name="doSearch" value="true"> <input type="submit" class="jz_submit" value="Go"> </form> </td> </tr> </table> <?php // Now let's see if we need the breadcrumbs if ($_GET['jz_path'] != "") { ?> <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="1%" valign="middle" nowrap> <?php if ($cms_mode == "true") { $mode = "POST"; } else { $mode = "GET"; } $mode = "GET"; if (isset($_POST['jz_path'])) { $bcArray = explode("/", $_POST['jz_path']); } else { $bcArray = explode("/", $_GET['jz_path']); } // Now we need to cut the last item off the list $bcArray = array_slice($bcArray, 0, count($bcArray) - 1); // Now let's display the dropdown for where we are echo '<form action="' . $this_page . '" method="' . $mode . '">' . "\n"; echo '<select style="width:175px" class="jz_select" name="' . jz_encode('jz_path') . '" onChange="form.submit();">' . "\n"; $parent = $node->getParent(); $nodes = $parent->getSubNodes("nodes"); sortElements($nodes); foreach ($nodes as $child) { $path = $child->getPath("String"); echo '<option '; // Is this the current one? if ($child->getName() == $node->getName()) { echo ' selected '; } echo 'value="' . jz_encode($path) . '">' . $display->returnShortName($child->getName(), 20) . '</option>' . "\n"; } echo '</select>' . "\n"; //$display->hiddenVariableField("jz_path"); $display->hiddenPageVars(); echo '<input type="hidden" name="frontend" value="' . $_GET['frontend'] . '">' . "\n"; echo "</form>"; ?> </td> <td valign="middle" nowrap> <?php $display->playButton($node); echo " "; $display->randomPlayButton($node); $url_array = array(); $url_array['jz_path'] = $node->getPath("String"); $url_array['action'] = "popup"; $url_array['ptype'] = "iteminfo"; echo ' <a onclick="openPopup(this, 450, 450); return false;" href="' . urlize($url_array) . '"><img src="' . $image_dir . 'more.gif" border="0"></a>'; ?> </td> <?php if ($display->wantResampleDropdown($node)) { ?> <td align="right"> <?php $display->displayResampleDropdown($node, word("Resample") . ": "); ?> </td> <?php } ?> </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> <?php } else { if ($display->wantResampleDropdown($node)) { ?> <table width="100%" cellspacing="0" cellpadding="0"><tr> <td align="right"> <?php $display->displayResampleDropdown($node, word("Resample") . ": "); ?> </td> </tr></table> <?php } } // ARTIST ALPHA: in header or only for root? Put the following in pageTop for the first... if ($show_artist_alpha == "true") { $blocks->alphabeticalList($node, "artist", 0); } }
<?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');
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'); }
/** * Preheader stuff. Things this function handles: * title, css, javascript * 'morejs' allows you to add page-specific javascript to a page. * * **should this also set the page width? * * @author Ben Dodson * @version 11/29/04 * @since 11/29/04 */ function preheader($title = false, $width = "100%", $align = "left", $js = true, $gzip = true, $cms_open = true, $minimal_theme = false) { global $css, $cms_type, $site_title, $include_path, $root_dir, $node, $live_update, $gzip_handler, $jzSERVICES, $skin, $ajax_list, $jukebox, $my_frontend, $secure_links; // Are they doing gzip compression? if ($gzip_handler == "true" and $gzip == true and $cms_type != "mambo" and $cms_type != "cpgnuke") { @ob_start('ob_gzhandler'); } $fe = new jzFrontend(); $display = new jzDisplay(); $smarty = smartySetup(); // Now let's see if we need to open a CMS or not? if ($cms_open) { $jzSERVICES->cmsOpen(); } $css = $jzSERVICES->cmsCSS(); $showHeader = false; if (!isset($cms_mode) || $cms_mode === false || $cms_mode == "false") { $showHeader = true; $smarty->assign('favicon', $include_path . 'style/favicon.ico'); $smarty->assign('site_title', $site_title); if ($title !== false) { $smarty->assign('site_title', $site_title . " - " . str_replace("</nobr>", "", str_replace("<nobr>", "", str_replace("<br>", " ", $title)))); } $smarty->assign('rss_link', $include_path . 'rss.php?type=most-played'); } $smarty->assign('root_dir', $root_dir); if (!$minimal_theme) { $smarty->assign('css', $css); } $smarty->assign('skin', $skin); $smarty->assign('secure_links', $secure_links); $smarty->assign('fav_icon', $root_dir . '/style/favicon.ico'); // Now let's display the template if ($showHeader) { $smarty->display(SMARTY_ROOT . 'templates/slick/header-pre.tpl'); } // AJAX: $this->handleAJAX(); // Required for overlibs / wherever colors are needed in raw HTML. $define_only = true; if ($minimal_theme) { $define_only = true; } include $css; unset($define_only); //!! Stuff that requires database is safe beyond this point. !!// if ($live_update == "true" && !(isset($_GET['action']) && $_GET['action'] == "search")) { updateNodeCache($node); } if (!(isset($_GET['action']) && $_GET['action'] == "search")) { handlePageView($node); } }
function drawPage(&$node) { global $album_name_truncate, $web_root, $root_dir, $disable_random, $allow_download, $allow_send_email, $amg_search, $echocloud, $include_path, $enable_ratings, $img_play, $img_random_play, $this_page, $img_check, $img_check_none, $jzUSER, $img_play_dis, $img_random_play_dis, $show_sampler, $show_similar, $show_radio, $show_album_art, $days_for_new, $sort_by_year, $jzSERVICES; // Let's setup our objects $display =& new jzDisplay(); $blocks =& new jzBlocks(); $fe =& new jzFrontend(); $smarty = smartySetup(); // Let's grab the data from the backend $nodes = $node->getSubNodes("nodes"); $tracks = $node->getSubNodes("tracks"); // Do we need the left colum $show_profile_col = false; if (sizeof($nodes) > 0) { $show_profile_col = true; } if (($node->getMainArt() != "" or $node->getDescription() != "") and $show_album_art != "false") { $show_profile_col = true; } $smarty->assign('show_album_block', false); if (sizeof($nodes) > 0) { $smarty->assign('show_album_block', true); } $smarty->assign('show_artist_profile', false); $art = $node->getMainArt(); // let's make sure we have a profile to show if (($art or $node->getDescription() != "") and $show_album_art == "true") { $smarty->assign('show_artist_profile', true); } // Now let's see if there are random tracks here $smarty->assign('show_tracks', false); if (count($tracks) != 0) { $smarty->assign('show_tracks', true); // Now let's setup our buttons for later $playButtons = $display->playLink($node, $img_play, false, false, true) . $display->playLink($node, $img_random_play, false, false, true, true); // Now let's make sure they can stream if (!$jzUSER->getSetting('stream')) { $playButtons = $img_play_dis . $img_random_play_dis; } if ($jzUSER->getSetting('download')) { $playButtons .= $display->downloadButton($node, true, true, true); } else { $playButtons .= $display->downloadButton($node, true, true, true); } $playButtons .= $display->podcastLink($node); if ($enable_ratings == "true") { $playButtons .= $display->rateButton($node, true); } $playButtons .= " "; $smarty->assign('playButtons', $playButtons); } // Do they want the sampler? $smarty->assign('show_sampler', false); if ($show_sampler == "true" && sizeof($nodes) > 1) { $smarty->assign('show_sampler', true); } // Do they want either of these? $smarty->assign('show_sim_col', false); if ($show_similar == "true" or $show_radio == "true") { $smarty->assign('show_sim_col', true); } $smarty->assign('show_profile_col', $show_profile_col); // Now let's display the correct template if (count($nodes) == 1) { $smarty->assign('show_sampler', true); $_GET['action'] = "viewalltracks"; } $smarty->display(SMARTY_ROOT . 'templates/slick/artist.tpl'); }