Exemplo n.º 1
0
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');
}
Exemplo n.º 2
0
 /**
  * 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');
 }
Exemplo n.º 3
0
 function handleRules()
 {
     global $jzSERVICES;
     if ($this->getPlType() != "dynamic") {
         return false;
     }
     $temp = array();
     $this->list = array();
     foreach ($this->rulelist as $rule) {
         $source = new jzMediaNode($rule['source']);
         $count = $rule['amount'];
         if ($rule['type'] == "track" || $rule['type'] == "tracks") {
             $type = "tracks";
             $distance = -1;
         } else {
             $type = "nodes";
             $distance = distanceTo("album", $source);
         }
         switch ($rule['function']) {
             case "exact":
                 if ($type == "tracks") {
                     $source = new jzMediaTrack($rule['source']);
                 }
                 $temp = array($source);
                 break;
             case "random":
                 $temp = $source->getSubNodes($type, $distance, true, $count);
                 break;
             case "topplayed":
                 $temp = $source->getMostPlayed($type, $distance, $count);
                 break;
             case "recentlyadded":
                 $temp = $source->getRecentlyAdded($type, $distance, $count);
                 break;
             case "similar":
                 if ($source->getPType() == "artist") {
                     $mainArray = $source->getSubNodes($type, $distance, true, $count);
                     // Now let's get the top 5 similar artists
                     $simArray = $jzSERVICES->getSimilar($source);
                     $simArray = seperateSimilar($simArray);
                     $i = 0;
                     $limit = 8;
                     // Now let's shuffle
                     $similarArray = array();
                     for ($e = 0; $e < count($simArray['matches']); $e++) {
                         if (isset($simArray['matches'][$e])) {
                             // Ok, this is one that we want, let's get it's path
                             $simArt = $simArray['matches'][$e];
                             $subArray = $simArt->getSubNodes($type, $distance, true, $count / 1.5);
                             $similarArray = array_merge($similarArray, $subArray);
                             $i++;
                             if ($limit) {
                                 if ($i > $limit) {
                                     break;
                                 }
                             }
                         }
                     }
                     $finArray = array_merge($similarArray, $mainArray);
                     shuffle($finArray);
                     $temp = array();
                     for ($i = 0; $i < $count; $i++) {
                         $temp[] = $finArray[$i];
                     }
                 } else {
                     $temp = $source->getSubNodes($type, $distance, true, $count);
                 }
                 break;
         }
         foreach ($temp as $l) {
             $this->list[] = $l;
         }
     }
     shuffle($this->list);
     if (isset($this->limit) && $this->limit > 0) {
         $this->truncate($this->limit);
     }
 }
Exemplo n.º 4
0
            ?>
</em>','<?php 
            echo $dnl_url;
            ?>
',null,''],
				],
				<?php 
            // This ends the IF from way above
        }
        ?>
				<?php 
        // Let's see if they wanted to auto search Echocloud
        if ($echocloud != "0") {
            // Ok, now we need to search Echocloud to get matches to this artist
            $sim = $jzSERVICES->getSimilar($node);
            $simArr = seperateSimilar($sim);
            // Let's make sure that opened ok
            if ($sim != array()) {
                // Ok, now let's clean up what we got back
                // Now let's see if there are results
                $ecArray = $simArr['matches'];
                if (count($ecArray) >= 1) {
                    ?>
									['<?php 
                    echo icon('more');
                    ?>
','<?php 
                    echo $word_echocloud;
                    ?>
',null,null,'',
								<?php 
Exemplo n.º 5
0
 /**
  * Displays a the radio button for the node and it's similar nodes
  * 
  * 
  * @author Ross Carlson
  * @version 01/15/05
  * @since 01/10/05
  */
 function radioPlayButton($node, $limit = false, $text = false)
 {
     global $img_play, $jzUSER, $img_play_dis, $jzSERVICES;
     if (checkPermission($jzUSER, 'play', $node->getPath('String')) === false) {
         echo $img_play_dis;
         return;
     }
     $simArray = $jzSERVICES->getSimilar($node);
     $simArray = seperateSimilar($simArray);
     if (sizeof($simArray['matches']) == 0) {
         return false;
     }
     $arr = array();
     $arr['action'] = "playlist";
     $arr['mode'] = "radio";
     if ($limit !== false) {
         $arr['limit'] = $limit;
     }
     if ($node->getType() == "jzPlaylist") {
         $arr['type'] = "playlist";
     } else {
         $arr['jz_path'] = $node->getPath("String");
     }
     echo '<a href="' . urlize($arr) . '"';
     // Now are they using a popup player?
     if (checkPlayback() == "embedded") {
         // Ok, let's put the popup in the href
         echo $jzSERVICES->returnPlayerHref();
     }
     echo '>';
     if ($text === false) {
         echo $img_play;
     } else {
         echo $text;
     }
     echo "</a>";
     return true;
 }