当前位置: 首页>>代码示例>>PHP>>正文


PHP distanceTo函数代码示例

本文整理汇总了PHP中distanceTo函数的典型用法代码示例。如果您正苦于以下问题:PHP distanceTo函数的具体用法?PHP distanceTo怎么用?PHP distanceTo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了distanceTo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: pageTop

    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>
		
			<?php 
    }
开发者ID:seanfbrown,项目名称:jinzora,代码行数:34,代码来源:header.php

示例2: mklink

function mklink($l)
{
    global $arr;
    $arr['jz_level'] = distanceTo("artist");
    $arr['jz_letter'] = $l;
    return urlize($arr);
}
开发者ID:seanfbrown,项目名称:jinzora,代码行数:7,代码来源:bottomframe.php

示例3: doTemplate

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');
}
开发者ID:seanfbrown,项目名称:jinzora,代码行数:51,代码来源:lists.php

示例4: seperateSimilar

function seperateSimilar($array)
{
    if (!is_array($array) || sizeof($array) == 0) {
        $ret = array();
        $ret['nonmatches'] = array();
        $ret['matches'] = array();
        return $ret;
    }
    // We don't want more artists in the array than we came with.
    // The searching is what actually needs to be improved (with operator = "exact-or")
    $ret = array();
    $root = new jzMediaNode();
    $found = $root->search($array, "nodes", distanceTo('artist'), sizeof($array), "or");
    $ret['matches'] = $found;
    // Now let's remove the matches:
    $matches = array();
    foreach ($found as $e) {
        $matches[] = $e->getName();
    }
    $nonmatches = array();
    foreach ($array as $entry) {
        $foundit = false;
        foreach ($matches as $match) {
            if (0 == strcmp(strtolower($match), strtolower($entry))) {
                // Found it
                $foundit = true;
                break;
            }
        }
        if (!$foundit) {
            $nonmatches[] = $entry;
        }
    }
    $ret['nonmatches'] = $nonmatches;
    return $ret;
}
开发者ID:seanfbrown,项目名称:jinzora,代码行数:36,代码来源:services.php

示例5: jzDisplay

<?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');
开发者ID:seanfbrown,项目名称:jinzora,代码行数:15,代码来源:randomAlbums.php

示例6: getCurNodeList

function getCurNodeList()
{
    global $sort_by_year, $node;
    $display =& new jzDisplay();
    if (isset($_GET['jz_letter'])) {
        $root = new jzMediaNode();
        $nodes = $root->getAlphabetical($_GET['jz_letter'], "nodes", distanceTo("artist"));
    } else {
        if (isset($_SESSION['JZ_CURRENT_MEDIA_LIST'])) {
            // Removed while coding
            //return $_SESSION['JZ_CURRENT_MEDIA_LIST'];
        }
        $nodes = $node->getSubNodes("nodes");
    }
    if ($sort_by_year == "true") {
        sortElements($nodes, "year");
    } else {
        sortElements($nodes, "name");
    }
    $itemArray = array();
    // Now let's loop through the nodes
    foreach ($nodes as $item) {
        $itemArray[] = array("name" => $item->getName(), "path" => $item->getPath(), "link" => $display->link($item, "VIEW", false, false, true), "playlink" => $display->playLink($item, "PLAY", false, false, true));
    }
    $_SESSION['JZ_CURRENT_MEDIA_LIST'] = $itemArray;
    return $itemArray;
}
开发者ID:seanfbrown,项目名称:jinzora,代码行数:27,代码来源:header.php

示例7: word

							<nobr>
								<?php 
    echo word('Album');
    ?>
:
							</nobr>
						</td>
						<td width="70%" valign="top">
							<!--
							<select name="edit_item_parent" class="jz_select" style="width:185px;">
								<?php 
    // Now let's get all the items at this level
    $root = new jzMediaNode();
    switch ($node->getPType()) {
        case "artist":
            $valArr = $root->getSubNodes("nodes", distanceTo("genre"));
            break;
    }
    for ($e = 0; $e < count($valArr); $e++) {
        echo '<option ';
        if ($valArr[$e]->getName() == $parent->getName()) {
            echo ' selected ';
        }
        echo 'value="' . $valArr[$e]->getName() . '">' . $valArr[$e]->getName() . "</option>\n";
    }
    ?>
							</select>-->
							<?php 
    echo $album->getName();
    ?>
						</td>
开发者ID:seanfbrown,项目名称:jinzora,代码行数:31,代码来源:iteminfo.php

示例8: slickRandomAlbums

    /**
     * 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> &nbsp; ';
        // 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;
//.........这里部分代码省略.........
开发者ID:jinzora,项目名称:jinzora3,代码行数:101,代码来源:blocks.php

示例9: generateStats

 /**
  * Creates all of our statistics.
  * 
  * @author Ben Dodson
  * @version 11/16/04
  * @since 11/16/04
  * @param $string specifically what to return, defaults to everything
  */
 function generateStats($return = false)
 {
     $stats = array();
     // have to do it...
     $elements = $this->getSubNodes("tracks", -1);
     $length = $size = $bitrate = $year = $yearc = $lengthc = $brc = $sizec = $tracks = 0;
     foreach ($elements as $track) {
         $tracks++;
         $meta = $track->getMeta();
         if ($meta['length'] != '-' && $meta['length'] > 0) {
             $length += $meta['length'];
             $lengthc++;
         }
         if ($meta['size'] != '-' && $meta['size'] > 0) {
             $size += $meta['size'];
             $sizec++;
         }
         if ($meta['year'] != '-' && $meta['year'] > 1000) {
             $year += $meta['year'];
             $yearc++;
         }
         if ($meta['bitrate'] != '-' && $meta['bitrate'] > 0) {
             $bitrate += $meta['bitrate'];
             $brc++;
         }
     }
     if ($tracks == 0) {
         return false;
     }
     $stats['total_size'] = $size;
     $stats['total_length'] = $length;
     $stats['total_tracks'] = $tracks;
     $stats['avg_bitrate'] = @round($bitrate / $brc, 2);
     $stats['avg_length'] = @round($length / $lengthc, 0);
     $stats['avg_size'] = @round($size / $sizec, 2);
     $stats['avg_year'] = @round($year / $yearc, 2);
     $str = "";
     // stringize stuff:
     $stats['avg_length_str'] = stringize_time($stats['avg_length']);
     $stats['total_length_str'] = stringize_time($stats['total_length']);
     $stats['total_size_str'] = stringize_size($stats['total_size']);
     // Now did we want to return something specific
     if ($return) {
         return $stats[$return];
     }
     if (($d = distanceTo('genre', $this)) !== false) {
         $stats['total_genres'] = $this->getSubNodeCount('nodes', $d);
     } else {
         $stats['total_genres'] = 0;
     }
     if (($d = distanceTo('artist', $this)) !== false) {
         $stats['total_artists'] = $this->getSubNodeCount('nodes', $d);
     } else {
         $stats['total_artists'] = 0;
     }
     if (($d = distanceTo('album', $this)) !== false) {
         $stats['total_albums'] = $this->getSubNodeCount('nodes', $d);
     } else {
         $stats['total_albums'] = 0;
     }
     // nodes at track level are disks.
     if (($d = distanceTo('track', $this)) !== false) {
         $stats['total_disks'] = $this->getSubNodeCount('nodes', $d);
     } else {
         $stats['total_disks'] = 0;
     }
     $this->stats = $stats;
 }
开发者ID:seanfbrown,项目名称:jinzora,代码行数:76,代码来源:class-node.php

示例10: jzMediaNode

    echo '<input type="hidden" name="return" value="' . $_GET['return'] . '">';
}
// See if they ran a search.
if ($search != "") {
    // Now let's get all the genres from our backend
    $root =& new jzMediaNode();
    $matches = $root->search($search, "nodes", distanceTo("artist"));
    // arrayify search.
    echo '<select name="' . jz_encode("chosenPath") . '"size="18" class="jz_select" style="width: 200px" onChange="submit()">';
    for ($i = 0; $i < count($matches); $i++) {
        echo '<option value="' . jz_encode($matches[$i]->getPath("String")) . '">' . $matches[$i]->getName();
    }
    echo "</select>";
} else {
    if (isset($_GET['i'])) {
        // Now let's get all the artists from our cache file
        $root =& new jzMediaNode();
        $matches = $root->getAlphabetical($_GET['i'], "nodes", distanceTo("artist"));
        echo '<select name="' . jz_encode("chosenPath") . '"size="18" class="jz_select" style="width: 200px" onChange="submit()">';
        for ($i = 0; $i < count($matches); $i++) {
            echo '<option value="' . jz_encode($matches[$i]->getPath("String")) . '">' . $matches[$i]->getName();
        }
        echo '</select>';
    }
}
echo "</form>";
echo "<br><br>";
$this->closeButton();
echo "</center>";
$this->closeBlock();
exit;
开发者ID:seanfbrown,项目名称:jinzora,代码行数:31,代码来源:artist.php

示例11: standardPage

    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 "&nbsp;";
            $display->randomPlayButton($item);
            ?>
							&nbsp;
						</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];
                ?>
">
//.........这里部分代码省略.........
开发者ID:seanfbrown,项目名称:jinzora,代码行数:101,代码来源:header.php

示例12: word

        $limit = 50;
        $title .= $limit . " " . word("Viewed Artists");
        $type = "artist";
        $func = "getMostViewed";
        $showCount = "view";
        break;
}
$this->displayPageTop("", $title);
$this->openBlock();
// Now let's get the recently added items
if ($type == "track") {
    $retType = "tracks";
} else {
    $retType = "nodes";
}
$recent = $node->{$func}($retType, distanceTo($type, $node), $limit);
// Now let's loop through the results
for ($i = 0; $i < count($recent); $i++) {
    // Now let's create our node and get the properties
    $item = $recent[$i];
    $album = $item->getName();
    $parent = $item->getParent();
    $artist = $parent->getName();
    // Now let's create our links
    $albumArr['jz_path'] = $item->getPath("String");
    $artistArr['jz_path'] = $parent->getPath("String");
    // Now let's create our short names
    $artistTitle = returnItemShortName($artist, $album_name_truncate);
    $albumTitle = returnItemShortName($album, $album_name_truncate);
    // Now let's display it
    echo "<nobr>";
开发者ID:seanfbrown,项目名称:jinzora,代码行数:31,代码来源:topstuff.php

示例13: drawPage

function drawPage(&$node)
{
    global $media_dir, $skin, $hierarchy, $album_name_truncate, $web_root, $root_dir, $jz_MenuItemLeft, $jz_MenuSplit, $jz_MenuItemHover, $jz_MainItemHover, $jz_MenuItem, $disable_random, $allow_download, $allow_send_email, $amg_search, $echocloud, $include_path, $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, $img_new, $num_album_cols, $show_album_art, $art_size;
    $display =& new jzDisplay();
    $blocks =& new jzBlocks();
    $fe =& new jzFrontend();
    handleFrontendOverrides();
    ?>
		<table width="100%" cellpadding="5" cellspacing="0" border="0">
			<tr>
				<?php 
    // Now what to show?
    if (isset($_GET['jz_path'])) {
        ?>
					<td align="center" valign="top">
						<table width="100%" cellpadding="3" cellspacing="0" border="0">
							<tr>
								<td class="jz_block_td" colspan="3">
									<strong>ALBUMS BY <?php 
        echo $display->link($node, $node->getName());
        ?>
</strong>
								</td>
							</tr>
							<?php 
        $colwidth = floor(100 / $num_album_cols);
        $albums = $node->getSubNodes("nodes", distanceTo("album", $node));
        $c = 0;
        foreach ($albums as $album) {
            // Now let's start our row
            if ($c % $num_album_cols == 0) {
                if ($c > 0) {
                    echo '</tr>';
                }
                echo '<tr>';
            }
            echo '<td class="jz_nj_block_body" valign="top" width="' . $colwidth . '%">';
            $display->playButton($album);
            echo " ";
            $linktext = $album->getName();
            if ($show_album_art == "true") {
                if ($art = $album->getMainArt($art_size . 'x' . $art_size)) {
                    $linktext .= '<br/>';
                    $linktext .= $display->returnImage($art);
                }
            }
            $display->link($album, $linktext, word("Browse: ") . $album->getName());
            //echo " (". $album->getSubNodeCount("tracks"). ")";
            echo '</td>';
            $c++;
        }
        // Now let's finish out
        while ($c % $num_album_cols != 0) {
            echo '<td class="jz_nj_block_body">&nbsp;</td>';
            $c++;
        }
        ?>
				                    </tr>
						</table>
						<br>
					
					</td>
				<?php 
    } else {
        /*
        				?>
        <td align="center" valign="top">
        	<table width="100%" cellpadding="3" cellspacing="0" border="0">
        		<tr>
        			<td class="jz_block_td">
        				<strong>LATEST ARTISTS</strong>
        			</td>
        		</tr>
        		<tr>
        			<td class="jz_nj_block_body">
        				<table width="100%" cellpadding="3" cellspacing="0" border="0">
        				<?php
        					// Now how many should we show?
        					$show = round(((count($genres) / 3)) * 1.5);
        					$blocks->showCharts($node,"newartists",$show,false,false);
        				?>
        				</table>
        			</td>
        		</tr>
        	</table>
        </td>
        <td align="center">&nbsp;</td>
        <td align="center" valign="top">
        	<table width="100%" cellpadding="3" cellspacing="0" border="0">
        		<tr>
        			<td class="jz_block_td">
        				<strong>LATEST ALBUMS</strong>
        			</td>
        		</tr>
        		<tr>
        			<td class="jz_nj_block_body">
        				<table width="100%" cellpadding="3" cellspacing="0" border="0">
        				<?php
        					$show = round(((count($genres) / 3)) * 1.5);
        					$blocks->showCharts($node,"newalbums",$show,false,false);
//.........这里部分代码省略.........
开发者ID:seanfbrown,项目名称:jinzora,代码行数:101,代码来源:artist.php

示例14: header

 }
 // switch
 // Now let's display the data
 header("Content-type: text/xml");
 echo '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n" . '<rdf:RDF' . "\n" . 'xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"' . "\n" . 'xmlns="http://purl.org/rss/1.0/"' . "\n" . 'xmlns:dc="http://purl.org/dc/elements/1.1/"' . "\n" . 'xmlns:slash="http://purl.org/rss/1.0/modules/slash/"' . "\n" . 'xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"' . "\n" . 'xmlns:admin="http://webns.net/mvcb/"' . "\n" . 'xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"' . "\n" . '>' . "\n" . '<channel rdf:about="http://www.jinzora.com">' . "\n" . '<title>Jinzora RSS</title>' . "\n" . '<link>http://www.jinzora.com</link>' . "\n" . "<description>Jinzora " . $title . "</description>\n" . "<items>\n" . "</items>\n" . '</channel>' . "\n";
 if (isset($_GET['root'])) {
     $node = new jzMediaNode(stripSlashes($_GET['root']));
 } else {
     $node = new jzMediaNode();
 }
 if ($distance == "track") {
     $returnType = "tracks";
 } else {
     $returnType = "nodes";
 }
 $arr = $node->{$func}($returnType, distanceTo($distance, $node), 5);
 for ($i = 0; $i < count($arr); $i++) {
     // Now let's create the display
     $art = $arr[$i]->getMainArt();
     $imgUrl = jzCreateLink($art, "image");
     $urlArr = array();
     $urlArr['action'] = "playlist";
     $urlArr['jz_path'] = $arr[$i]->getPath("String");
     if ($distance == "track") {
         $urlArr['type'] = "track";
     }
     $title_add = "";
     if ($showPlays) {
         $title_add = ' (' . $arr[$i]->getPlayCount() . ')';
     }
     if ($showDownload) {
开发者ID:seanfbrown,项目名称:jinzora,代码行数:31,代码来源:rss.php

示例15: jzMediaNode

         $root = new jzMediaNode($argv[3]);
     } else {
         $root = new jzMediaNode();
     }
     switch ($argv[2]) {
         case "genre":
         case "genres":
             $list = $root->getSubNodes("nodes", distanceTo("genre", $root));
             break;
         case "artist":
         case "artists":
             $list = $root->getSubNodes("nodes", distanceTo("artist", $root));
             break;
         case "album":
         case "albums":
             $list = $root->getSubNodes("nodes", distanceTo("album", $root));
             break;
         case "track":
         case "tracks":
             $list = $root->getSubNodes("tracks", -1);
             break;
     }
     if (isset($list)) {
         foreach ($list as $el) {
             echo $el->getName() . "\n";
         }
     }
     break;
 case "search_metadata":
     if (isset($argv[2])) {
         $node = new jzMediaNode($argv[2]);
开发者ID:seanfbrown,项目名称:jinzora,代码行数:31,代码来源:cli.php


注:本文中的distanceTo函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。