コード例 #1
0
ファイル: blocks.php プロジェクト: jinzora/jinzora3
 /**
  * Displays a table of the given video tracks.
  *
  * @author Ross Carlson
  * @version 2.26.06
  * @since 2.26.06
  * @param array $tracks The array of objects of each track
  * @param $purpose The type of this track table. One of:
  * generic|album|search|sample|sample-all
  */
 function videoTable($tracks, $purpose = false)
 {
     global $web_root, $root_dir, $row_colors;
     $display = new jzDisplay();
     // Let's setup Smarty
     $smarty = smartySetup();
     // Let's define our variables
     $i = 0;
     foreach ($tracks as $child) {
         $metaData = $child->getMeta();
         $tArr[$i]['name'] = $display->returnShortName($child->getName(), 25);
         $tArr[$i]['length'] = convertSecMins($metaData['length']);
         $tArr[$i]['playlink'] = $display->playlink($child, $child->getName(), false, false, true, false, true);
         $tArr[$i]['downloadlink'] = $display->downloadButton($child, true, false, false, true);
         $tArr[$i]['i'] = $i;
         $art = $child->getMainArt("125x125", true, "video");
         if ($art) {
             $tArr[$i]['art'] = $art;
         } else {
             $tArr[$i]['art'] = false;
         }
         $tArr[$i]['playcount'] = $child->getPlayCount();
         $i++;
     }
     $smarty->assign('tracks', $tArr);
     $smarty->assign('i', 0);
     $smarty->assign('cols', 3);
     $smarty->assign('jz_row1', $row_colors[1]);
     $smarty->assign('jz_row2', $row_colors[2]);
     $smarty->assign('word_watch_now', word("Watch Now"));
     $smarty->assign('word_download', word("Download"));
     $smarty->assign('word_viewed', word("Viewed"));
     // Now let's include the template
     $smarty->display(SMARTY_ROOT . 'templates/slick/videotable.tpl');
 }
コード例 #2
0
ファイル: blocks.php プロジェクト: seanfbrown/jinzora
    /**
     * Shows the chart system
     * 
     * @author Ross Carlson
     * @version 01/26/05
     * @since 01/26/05
     * @param $node The node we are viewing so we can filter
     * @param $types The charts to display. Comma seperated list of:
     * topplayalbum, topplayartist, topdownalbum, newalbums, newartists, newtracks
     * recentplayalbum, recentplayartist, recentplaytrack,
     * topratedalbum, topratedartist, topviewartist, topplaytrack
     * @param $numItems The number of items we want to return (defaults to 5)
     * @param $format Should we format this or return raw data (defaults to true)
     * @param $opts an array of extra options (transitioning to new parameter scheme)
     * 
     */
    function showCharts($node, $types = false, $numItems = false, $format = true, $vertAlign = false, $opts = false)
    {
        global $album_name_truncate, $img_tiny_play, $img_tiny_play_dis, $jzUSER, $img_rss, $root_dir, $advanced_tooltips, $rss_in_charts, $num_items_in_charts, $chart_timeout_days, $chart_types;
        $be = new jzBackend();
        if ($be->hasFeature('charts') === false) {
            return;
        }
        // Let's setup our objects
        $blocks = new jzBlocks();
        $display = new jzDisplay();
        $nobr = true;
        if ($opts !== false) {
            if (isset($opts['allow_breaks'])) {
                $nobr = false;
            } else {
                $nobr = true;
            }
        }
        // Now let's do a loop creating all our blocks
        if ($types === false || $types == "") {
            if (isset($chart_types) && !isNothing($chart_types)) {
                $b = $chart_types;
            } else {
                $b = "topplayalbum,topplayartist,topviewartist,newalbums";
            }
        } else {
            $b = $types;
        }
        $bArray = explode(",", $b);
        for ($e = 0; $e < count($bArray); $e++) {
            // Now let's create our blocks
            $showPlays = false;
            switch ($bArray[$e]) {
                case "topplayalbum":
                    $func = "getMostPlayed";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "played-albums";
                    $title = word("Top Played Albums");
                    $distance = "album";
                    $showPlays = true;
                    $showDownload = false;
                    $rss = "most-played";
                    break;
                case "topplayartist":
                    $func = "getMostPlayed";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "played-artists";
                    $title = word("Top Played Artists");
                    $distance = "artist";
                    $showPlays = true;
                    $showDownload = false;
                    $rss = "most-played-artist";
                    break;
                case "topdownalbum":
                    $func = "getMostDownloaded";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "downloaded-albums";
                    $title = word("Top Downloaded Albums");
                    $distance = "album";
                    $showDownload = true;
                    $rss = "most-downloaded";
                    break;
                case "newalbums":
                    $func = "getRecentlyAdded";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "new-albums";
                    $title = word("New Albums");
                    $distance = "album";
                    $showDownload = false;
                    $rss = "last-added";
                    break;
                case "newartists":
                    $func = "getRecentlyAdded";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "new-artists";
                    $title = word("New Artists");
                    $distance = "artist";
                    $showDownload = false;
                    $rss = "last-added-artists";
                    break;
                case "newtracks":
                    $func = "getRecentlyAdded";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "new-tracks";
                    $title = word("New Tracks");
                    $distance = "track";
                    $showDownload = false;
                    $rss = "last-added-tracks";
                    break;
                case "recentplaytrack":
                    $func = "getRecentlyPlayed";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "recentplayed-tracks";
                    $title = word("Recently Played Tracks");
                    $distance = "track";
                    $showDownload = false;
                    $rss = "recentplayed-track";
                    break;
                case "topplaytrack":
                    $func = "getMostPlayed";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "played-tracks";
                    $title = word("Top Played Tracks");
                    $distance = "track";
                    $showDownload = false;
                    $rss = "most-played-tracks";
                    break;
                case "recentplayalbum":
                    $func = "getRecentlyPlayed";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "recentplayed-albums";
                    $title = word("Recently Played Albums");
                    $distance = "album";
                    $showDownload = false;
                    $rss = "recentplayed-album";
                    break;
                case "recentplayartist":
                    $func = "getRecentlyPlayed";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "recentplayed-artists";
                    $title = word("Recently Played Artists");
                    $distance = "artist";
                    $showDownload = false;
                    $rss = "recentplayed-artist";
                    break;
                case "topratedalbum":
                    $func = "getTopRated";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "toprated-albums";
                    $title = word("Top Rated Albums");
                    $distance = "album";
                    $showDownload = false;
                    $rss = "toprated-album";
                    break;
                case "topratedartist":
                    $func = "getTopRated";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "toprated-artists";
                    $title = word("Top Rated Artists");
                    $distance = "artist";
                    $showDownload = false;
                    $rss = "toprated-artist";
                    break;
                case "topviewartist":
                    $func = "getMostViewed";
                    $arr['action'] = "popup";
                    $arr['ptype'] = "topstuff";
                    $arr['tptype'] = "topviewed-artists";
                    $title = word("Most Viewed Artists");
                    $distance = "artist";
                    $showDownload = false;
                    $rss = "topviewed-artist";
                    break;
                default:
                    continue;
            }
            // Now let's get the data
            if ($distance == "track") {
                $returnType = "tracks";
            } else {
                $returnType = "nodes";
            }
            if ($numItems) {
                $num_items_in_charts = $numItems;
            }
            if ($chart_timeout_days > 0) {
                $be = new jzBackend();
                $data_id .= pathize('chart-' . $node->getPath("String")) . "-{$func}-{$distance}-{$num_items_in_charts}";
                if (($recent = $be->loadData($data_id, true)) === false) {
                    $recent = $node->{$func}($returnType, distanceTo($distance, $node), $num_items_in_charts);
                    $be->storeData($data_id, $recent, $chart_timeout_days);
                }
            } else {
                $recent = $node->{$func}($returnType, distanceTo($distance, $node), $num_items_in_charts);
            }
            // Now let's see if we got data
            if (count($recent) == 0) {
                continue;
            }
            ?>
			<td width="25%" valign="top">
				<?php 
            if ($format) {
                echo '<div id="slickMainBlockBody">';
            }
            ?>
				<table width="95%" cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td width="100%" valign="middle">
				   <?php 
            if ($nobr) {
                echo '<nobr>';
            }
            ?>
							<?php 
            if ($format) {
                // Now let's display the link to the FULL top played list
                echo '<a onclick="openPopup(this, 300, 450); return false;" title="' . $title . '" href="' . urlize($arr) . '"><strong>' . $title . '</strong></a>';
                // Let's link to the RSS feed
                if ($rss_in_charts == "true") {
                    echo ' - <a href="' . $root_dir . '/rss.php?type=' . $rss;
                    if ($node->getLevel() != 0) {
                        echo '&root=' . $node->getPath("String");
                    }
                    echo '">' . $img_rss . '</a>';
                }
                echo '<br>';
            }
            // 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 = $artnode = $recent[$i];
                $album = $item->getName();
                $parent = $item->getAncestor("artist");
                if ($parent !== false) {
                    $artist = $parent->getName();
                }
                $albumDLCount = $item->getDownloadCount();
                $year = $item->getYear();
                $dispYear = "";
                if ($year != "-") {
                    $dispYear = " (" . $year . ")";
                }
                // Now let's create our links
                if ($distance == "track") {
                    $artnode = $item->getAncestor("album");
                    if (is_object($artnode)) {
                        $albumArr['jz_path'] = $artnode->getPath("String");
                        $gp = $item->getAncestor("artist");
                        if (is_object($gp)) {
                            $artistArr['jz_path'] = $gp->getPath("String");
                        } else {
                            $artistArr['jz_path'] = '';
                        }
                    } else {
                        $albumArr['jz_path'] = '';
                        $artistArr['jz_path'] = '';
                    }
                } else {
                    $albumArr['jz_path'] = $item->getPath("String");
                    if ($parent !== false) {
                        $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
                if ($nobr) {
                    echo "<nobr>";
                }
                if (!$jzUSER->getSetting('stream')) {
                    echo $img_tiny_play_dis;
                } else {
                    $display->playLink($item, $img_tiny_play, $album);
                }
                // Ok, did they want advanced tooltips?
                if ($advanced_tooltips == "true") {
                    // Now let's set the hover code
                    $innerOver = "";
                    $showTip = false;
                    if (($art = $artnode->getMainArt("75x75")) != false) {
                        $innerOver .= $display->returnImage($art, $artnode->getName(), 75, 75, "limit", false, false, "left", "3", "3");
                        $showTip = true;
                        $bTitle = $artist . " - " . $album . $dispYear;
                    } else {
                        // Ok, no art so let's make this look better
                        $innerOver .= "<strong>" . $artist . "<br>" . $album . $dispYear . "</strong><br>";
                        $bTitle = $album . $dispYear;
                    }
                    $desc_truncate = 200;
                    $desc = $item->getDescription();
                    if (!isNothing($desc)) {
                        $innerOver .= $display->returnShortName($desc, $desc_truncate);
                        $showTip = true;
                    }
                    // Now let's fix up
                    $innerOver = str_replace("'", "", str_replace('"', "", $innerOver));
                    $bTitle = str_replace("'", "", str_replace('"', "", $bTitle));
                    if ($showTip) {
                        $title = $display->returnToolTip($innerOver, $bTitle);
                    } else {
                        $title = ' title="' . $artist . ' - ' . $album . $dispYear . '"';
                    }
                } else {
                    // Standard tooltips
                    $title = ' title="' . $artist . ' - ' . $album . $dispYear . '"';
                }
                echo ' <a ' . $title . ' href="' . urlize($albumArr) . '">' . $albumTitle;
                if ($showPlays) {
                    if ($bArray[$e] == "topplayalbum") {
                        $albumPlayCount = $item->getSubNodeCount('tracks', -1);
                        if ($albumPlayCount > 0) {
                            $albumPlayCount = ceil($item->getPlayCount() / $albumPlayCount);
                        }
                    } else {
                        $albumPlayCount = $item->getPlayCount();
                    }
                    echo ' (' . $albumPlayCount . ')';
                }
                if ($showDownload) {
                    echo ' (' . $albumDLCount . ')';
                }
                echo "</a><br>";
                if ($nobr) {
                    echo "</nobr>";
                }
            }
            if ($nobr) {
                echo '</nobr>';
            }
            ?>
						</td>
					</tr>
				</table>
				<?php 
            if ($format) {
                echo '</div>';
            }
            ?>
			</td>
			    <?php 
            if ($vertAlign) {
                echo '</tr><tr>';
            }
            ?>
		<?php 
        }
    }
コード例 #3
0
ファイル: header.php プロジェクト: seanfbrown/jinzora
    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>
								&nbsp; | &nbsp;
							<?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 "&nbsp;";
            $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);
        }
    }
コード例 #4
0
ファイル: description.php プロジェクト: seanfbrown/jinzora
<?php

$smarty = smartySetup();
$display = new jzDisplay();
$desc = $node->getDescription();
if (isNothing($desc)) {
    return false;
}
if ($desc_truncate === false) {
    $desc_truncate = 700;
}
$smarty->assign('description', $display->returnShortName($desc, $desc_truncate));
$smarty->assign('read_more', "");
if (strlen($desc) > $desc_truncate) {
    $url_array = array();
    $url_array['jz_path'] = $node->getPath("String");
    $url_array['action'] = "popup";
    $url_array['ptype'] = "readmore";
    $smarty->assign('read_more', '<a href="' . urlize($url_array) . '" onclick="openPopup(this, 450, 450); return false;">...read more</a>');
}
jzTemplate($smarty, 'description');
コード例 #5
0
ファイル: ajax.php プロジェクト: seanfbrown/jinzora
/** 
 * Returns the AJAX code for the NSB
 *
 * @author Ross Carlson
 * @since 8.21.05
 *
 **/
function returnNowStreaming()
{
    global $jzUSER, $img_tiny_play, $im_tiny_play_dis, $css, $img_tiny_info, $skin, $root_dir, $include_path, $jzSERVICES, $who_is_where_height;
    $define_only = true;
    //include_once($include_path. $css);
    writeLogData("messages", "NSB: starting up");
    // Now let's figure out the height
    $be = new jzBackend();
    $display = new jzDisplay();
    $tracks = $be->getPlaying();
    $retVal = "";
    $count = 0;
    foreach ($tracks as $sid => $song) {
        // Let's make sure we got data
        if (count($song) != 0) {
            // Now let's setup for our links
            $url_array = array();
            $url_array['jz_path'] = $song['path'];
            $url_array['action'] = "playlist";
            $url_array['type'] = "track";
            $urlArr = array();
            $urlArr['session'] = $sid;
            $urlArr['action'] = "popup";
            $urlArr['ptype'] = "viewcurrentinfo";
            $infoLink = '<a href="' . str_replace("ajax_request", "index", urlize($urlArr)) . '" onclick="openPopup(this, 450, 300); return false;">' . $img_tiny_info . '</a>';
            $arr = array();
            $pArr = explode("/", $song['path']);
            unset($pArr[count($pArr) - 1]);
            $arr['jz_path'] = implode("/", $pArr);
            $songTrack = $display->returnShortName($song['track'], 15);
            /*
            if ($lyricsLink == ""){
            	$songTrack = $display->returnShortName($song['track'],15);
            } else {
            	$songTrack = $display->returnShortName($song['track'],13);
            }
            */
            $track = new jzMediaNode($song['path']);
            $item = $track->getParent();
            if ($item->getPType() == "disk") {
                $item = $item->getParent();
            }
            $album = $item->getName();
            $artParent = $item->getParent();
            $artist = $artParent->getName();
            $art = $item->getMainArt("75x75");
            if ($art) {
                $albumImage = str_replace("'", "\\'", str_replace('"', '', $display->returnImage($art, $album, 75, 75, "limit", false, false, "left", "3", "3")));
            } else {
                $albumImage = "";
            }
            $desc_truncate = 200;
            $desc = htmlentities(str_replace("'", "\\'", str_replace('"', '', $item->getDescription())));
            // Now let's set the title and body
            $title = htmlentities(str_replace("'", "\\'", str_replace('"', '', $artist . " - " . $song['track'])));
            $userName = $song['name'];
            if ($userName == "") {
                $userName = word("Anonymous");
            }
            if ($song['fullname'] != "") {
                $userName = $song['fullname'];
            }
            $body = "<strong>" . word("Streaming to: ") . $userName . "</strong><br>" . $albumImage . $display->returnShortName($desc, $desc_truncate);
            //$albumImage;
            $count++;
            if ($jzUSER->getSetting('stream')) {
                $retVal .= ' <a href="' . str_replace("ajax_request.php", "index.php", urlize($url_array)) . '"';
                if (checkPlayback() == "embedded") {
                    //$jzSERVICES = new jzServices();
                    $jzSERVICES->loadUserServices();
                    $retVal .= ' ' . $jzSERVICES->returnPlayerHref();
                }
                $retVal .= '>' . $img_tiny_play . '</a>' . $infoLink . '<a ' . $display->returnToolTip($body, $title) . ' target="_parent" href="' . str_replace("ajax_request", "index", urlize($arr)) . '">' . $songTrack . '</a><br>';
            } else {
                $retVal .= '' . $img_tiny_play_dis . '' . $infoLink . '<a ' . $display->returnToolTip($body, $title) . ' target="_parent" ' . $title . ' href="' . str_replace("ajax_request", "index", urlize($arr)) . '">' . $songTrack . '</a><br>';
            }
        }
    }
    if ($count == 1 or $count == 0) {
        $tCtr = "";
    } else {
        $tCtr = " (" . $count . ")";
    }
    $retVal = "<strong>" . word("Now Streaming") . $tCtr . "</strong><br />" . $retVal;
    $maxHeight = $who_is_where_height * 13 + 26;
    $style = "";
    if ($maxHeight < $count * 13 + 26) {
        $style = "<style>#whoiswhere{height: " . $maxHeight . "px;overflow:auto;}</style>";
    }
    $return = $style . $retVal;
    writeLogData("messages", "NSB: displaying data");
    echo $retVal;
    exit;
}
コード例 #6
0
ファイル: general.lib.php プロジェクト: jinzora/jinzora3
/** 
 * Grabs the data that was parsed from a Podcast
 *
 * @author Ross Carlson
 * @since 11/02/2005
 * @param $item An array with all the values to grab
 * @param $folder The subfolder to store the file in
 * @return boolean true|false
 *
 **/
function getPodcastData($item, $folder)
{
    global $include_path, $podcast_folder;
    if ($item['file'] == "") {
        return false;
    }
    $be = new jzBackend();
    $display = new jzDisplay();
    // Let's clean the new folder name
    $folder = trim(cleanFileName($folder));
    // Let's grab the file and save it to disk
    $ext = substr($item['file'], strlen($item['file']) - 3, 3);
    $track = trim(cleanFileName($item['title'] . "." . $ext));
    if (substr($podcast_folder, 0, 1) != "/") {
        $dir = str_replace("\\", "/", getcwd()) . "/" . $podcast_folder . "/" . $folder;
    } else {
        $dir = $podcast_folder . "/" . $folder;
    }
    $track = $dir . "/" . $track;
    // Now let's create the directory we need
    makedir($dir);
    // Now let's see if the file already exists
    if (!is_file($track)) {
        ?>
			<script language="javascript">
				t.innerHTML = '<?php 
        echo word("Downloading") . ": " . $display->returnShortName($item['title'], 45);
        ?>
';									
				-->
			</SCRIPT>
			<?php 
        flushdisplay();
        // Now let's grab the file and write it out
        $fName = str_replace("&amp;", "&", $item['file']);
        $data = file_get_contents($fName);
        $handle = fopen($track, "w");
        fwrite($handle, $data);
        fclose($handle);
        ?>
			<script language="javascript">
				t.innerHTML = '<?php 
        echo word("Download Complete!");
        ?>
';									
				-->
			</SCRIPT>
			<?php 
        flushdisplay();
    } else {
        ?>
			<script language="javascript">
				t.innerHTML = '<?php 
        echo word("Exists - moving to next track...");
        ?>
';									
				-->
			</SCRIPT>
			<?php 
        flushdisplay();
    }
    return $track;
}
コード例 #7
0
ファイル: jukebox.php プロジェクト: seanfbrown/jinzora
}
?>
				</td>
				<td width="5%" valign="top">
					<?php 
// Let's make sure they aren't streaming
if ($jb_playwhere == "stream") {
    echo '</td></tr></table>';
    return;
}
?>
					<?php 
if ($func['nowplaying']) {
    $curTrack = $jb->getCurrentTrackName();
    $fullname = $curTrack;
    $curTrack = $display->returnShortName($curTrack, 25);
    ?>
						<?php 
    echo word("Now Playing:") . ' <a href="javascript:;" title="' . $fullname . '">' . $curTrack . "</a><br>";
    ?>
						<!--
						<span ID="CurTicker" STYLE="overflow:hidden; width:275px;"  onmouseover="CurTicker_PAUSED=true" onmouseout="CurTicker_PAUSED=false">
							
						</span>
						-->
						<?php 
    if ($func['nexttrack']) {
        $fullList = $jb->getCurrentPlaylist();
        if ($fullList != array()) {
            $nextTrack = $fullList[getCurPlayingTrack() + 1];
            $fullname = $nextTrack;
コード例 #8
0
ファイル: topstuff.php プロジェクト: seanfbrown/jinzora
 $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>";
 $display->playLink($item, $img_tiny_play, $album);
 // Now let's set the hover code
 $innerOver = "";
 if (($art = $item->getMainArt()) != false) {
     $innerOver .= $display->returnImage($art, $item->getName(), 75, 75, "limit", false, false, "left", "3", "3");
 }
 $desc_truncate = 200;
 $desc = $item->getDescription();
 $innerOver .= $display->returnShortName($desc, $desc_truncate);
 if (strlen($desc) > $desc_truncate) {
     $innerOver .= "...";
 }
 $innerOver = str_replace('"', "", $innerOver);
 $innerOver = str_replace("'", "", $innerOver);
 // Now let's return our tooltip
 $capTitle = $artist . " - " . $album;
 $overCode = $display->returnToolTip($innerOver, $capTitle);
 echo ' <a onClick="opener.location.href=\'' . urlize($albumArr) . '\';window.close();" ' . $overCode . 'href="javascript:void()">' . $albumTitle;
 $cval = false;
 // TODO: showCount values can be:
 // view,dowload,play
 if ($showCount == "view") {
     $cval = $item->getViewCount();
 } else {
コード例 #9
0
ファイル: playlistedit.php プロジェクト: seanfbrown/jinzora
    echo $buttonlabel;
    ?>
" value="<?php 
    echo $e;
    ?>
" name="plTrackDel-<?php 
    echo $e;
    ?>
"/><?php 
    echo icon('clear', array('title' => word('Delete'), 'onclick' => "document.getElementById('{$buttonlabel}').click()"));
    ?>
						</td>
						<td width="1%">
							<nobr>
							<?php 
    echo $display->playlink($item, $display->returnShortName($track, 20));
    ?>
							</nobr>
						</td>
						<td width="1%">
							<nobr>
								<?php 
    echo $display->returnShortName($album, 20);
    ?>
							</nobr>
						</td>
						<td width="1%">
							<nobr>
								<?php 
    echo $display->returnShortName($artist, 20);
    ?>