コード例 #1
0
ファイル: blocks.php プロジェクト: seanfbrown/jinzora
 /**
  * Displays the grid of nodes for a standard page.
  *
  * @author Ben Dodson, Ross Carlson
  * @version 3/22/05
  * @since 3/22/05
  **/
 function nodeGrid($node, $distance = false)
 {
     global $hierarchy;
     $smarty = smartySetup();
     $display = new jzDisplay();
     $lvl = isset($_GET['jz_letter']) ? $_GET['jz_level'] + $node->getLevel() - 1 : $node->getLevel();
     switch ($hierarchy[$lvl]) {
         case "genre":
             $pg_title = word("Genres");
             break;
         case "artist":
             $pg_title = word("Artists");
             break;
         case "album":
             $pg_title = word("Albums");
             break;
         default:
             $pg_title = word("Genres");
             break;
     }
     if (isset($_GET['jz_letter'])) {
         $retArray = $node->getAlphabetical($_GET['jz_letter'], "nodes", $_GET['jz_level']);
         $letter = $_GET['jz_letter'];
     } else {
         $retArray = $node->getSubNodes("nodes", $distance);
     }
     sortElements($retArray, "name");
     if ($node->getName() != "") {
         $pg_title = $node->getName();
         if ($node->getSubNodeCount("nodes") > 0) {
             $pg_title .= " (" . $node->getSubNodeCount("nodes");
             if ($node->getSubNodeCount("tracks") > 0) {
                 $pg_title .= "+";
             }
             $pg_title .= ")";
         }
     } else {
         if (count($retArray) != 0) {
             $pg_title .= " (" . count($retArray) . ")";
         }
     }
     if ($display->startCache("nodeGrid", $node->getName(), $letter)) {
         return;
     }
     $_SESSION['jz_node_distance'] = $distance;
     $smarty->assign('jz_bg_color', jz_bg_color);
     $smarty->assign('title', $pg_title);
     $smarty->display(SMARTY_ROOT . 'templates/slick/nodegrid.tpl');
     // Now lets finish out the cache
     $display->endCache();
     flushdisplay();
 }
コード例 #2
0
ファイル: blocks.php プロジェクト: jinzora/jinzora3
 /**
  * Draws the Jinzora similar artist 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 string $onlyMatches Should we only display artists that are actually in your collection
  * @param bolean $limit Should we limit how many results we get back
  */
 function slickSimilarArtistBlock($artist, $onlyMatches = false, $limit = 10)
 {
     global $jzSERVICES, $album_name_truncate, $img_tiny_play, $show_similar;
     // First do they even want this?
     if ($show_similar != true) {
         return;
     }
     $display = new jzDisplay();
     if ($display->startCache("slickSimilarArtistBlock", $artist)) {
         return;
     }
     $this->similarArtistBlock($artist, $onlyMatches, $limit);
     // Now lets finish out the cache
     $display->endCache();
 }