コード例 #1
0
ファイル: blocks.php プロジェクト: jinzora/jinzora3
 /**
  * Displays the block for the artist profile on the Artist page
  *
  * @author Ben Dodson, Ross Carlson
  * @since 9/13/05
  * @version 9/13/05
  *
  **/
 function artistProfileBlock($node = false)
 {
     global $jzUSER, $album_name_truncate, $img_play, $img_random_play, $img_play_dis, $img_random_play_dis;
     $display = new jzDisplay();
     // Does the cache file exist?
     if ($display->startCache("artistProfileBlock", $node)) {
         return;
     }
     $art = $node->getMainArt("150x150");
     $desc_truncate = "700";
     $desc = $display->returnShortName($node->getDescription(), $desc_truncate);
     if ($desc == "") {
         $profile .= "<center><br>";
         if ($art !== false) {
             $profile .= $display->returnImage($art, $node->getName(), 150, 150, "limit");
         }
         $profile .= "<br><br></center>";
     } else {
         // Now let's show the art
         if ($art !== false) {
             $profile .= $display->returnImage($art, $node->getName(), 150, 150, "limit", false, false, "left", "5", "5");
         }
         $desc = str_replace("\n", "<p>", $desc);
         $profile .= $desc;
     }
     if ($desc == "" and $art == false) {
         return;
     }
     if ($display->plaintextStrlen($node->getDescription()) > $desc_truncate) {
         $url_array = array();
         $url_array['jz_path'] = $node->getPath("String");
         $url_array['action'] = "popup";
         $url_array['ptype'] = "readmore";
         $profile .= ' <a href="' . urlize($url_array) . '" onclick="openPopup(this, 450, 450); return false;">read more</a>';
     }
     if (!defined('NO_AJAX_LINKS') && $node === false) {
         $node = new jzMediaNode($_SESSION['jz_path']);
     }
     $nodes = $node->getSubNodes("nodes");
     // Let's create our buttons for later
     if ($jzUSER->getSetting('stream')) {
         $playButtons = $display->playLink($node, $img_play, false, false, true) . " " . $display->playLink($node, $img_random_play, false, false, true, true) . "&nbsp;";
     } else {
         $playButtons = $img_play_dis . $img_random_play_dis;
     }
     // Let's startup Smarty
     $smarty = smartySetup();
     // Now let's assign our variables to smarty
     $smarty->assign('title', word("Artist") . ": " . $node->getName() . " &nbsp; ");
     $smarty->assign('rating', $display->rating($node, true));
     $smarty->assign('playButtons', $playButtons);
     $smarty->assign('profile', $profile);
     // Now let's display the template
     $smarty->display(SMARTY_ROOT . 'templates/slick/artist-profile-block.tpl');
     // Now lets finish out the cache
     $display->endCache();
 }