Example #1
0
function drawPage(&$node)
{
    global $cols_in_genre, $cellspacing, $this_page, $img_play, $artist_truncate, $main_table_width, $img_random_play, $directory_level, $web_root, $root_dir, $img_more, $media_dir, $show_sub_numbers, $show_all_checkboxes, $img_more_dis, $img_play_dis, $img_random_play_dis, $url_seperator, $days_for_new, $img_rate, $enable_ratings, $enable_discussion, $img_discuss, $show_sub_numbers, $disable_random, $info_level, $days_for_new, $enable_playlist, $track_play_only, $css, $jinzora_skin, $bg_c, $text_c, $img_discuss_dis, $hierarchy, $random_albums, $frontend;
    // Let's see if the theme is set or not, and if not set it to the default
    //if (isset($_SESSION['cur_theme'])){ $_SESSION['cur_theme'] = $jinzora_skin; }
    // Let's setup the display object
    $display =& new jzDisplay();
    $blocks =& new jzBlocks();
    $fe =& new jzFrontend();
    // Now let's display the header
    // Let's see if they are viewing the Genre or not
    // Now let's get all the data for this level
    $retArray = $node->getSubNodes("both");
    // Now let's display the site description
    $news = $blocks->siteNews($node);
    if ($news != "") {
        echo "<br><center>" . $news . "<center>";
    }
    echo '<br><br>';
    //$blocks->blockHeader();
    $blocks->blockBodyOpen();
    // Now let's start our table to put the stuff in
    echo '<br>';
    jzTableOpen("100%", "3", "jz_col_table_main");
    jzTROpen("jz_col_table_tr");
    // Now let's figure out how wide our colum should be
    $cols_in_genre = 3;
    $col_width = returnColWidth(count($retArray));
    // Now let's figure out how many artists per column
    // adding the .49 make sure it always rounds up
    $folder_per_column = round(count($retArray) / $cols_in_genre + 0.49, 0);
    $first_loop = "";
    // Let's initialize some variables
    $ctr = 1;
    // Let's setup our form for below
    echo '<form action="' . $_SESSION['prev_page'] . '" name="trackForm" method="POST">';
    // Now let's loop through that array, displaying the items
    for ($i = 0; $i < count($retArray); $i++) {
        // Let's make sure that we found items to display
        if ($retArray[$i]->isLeaf()) {
            continue;
        } else {
            // Now let's see if this is a NEW directory or not
            //$new_from = checkForNew(jzstripslashes($genre. "/". $retArray[$i]));
            // NEW BACKEND: don't know how to handle this yet.
            // Let's count so we know where we are in making the columns
            // Then we'll add the links to the sub pages
            if ($ctr == 1) {
                if ($first_loop == "") {
                    $first_loop = "no";
                    jzTDOpen($col_width, "left", "top", "", "0");
                } else {
                    jzTDClose();
                    jzTDOpen($col_width, "left", "top", "", "0");
                }
            }
            // Let's see if we need to truncate the name
            $displayItem = returnItemShortName($retArray[$i]->getName(), $artist_truncate);
            // Now let's get the number of sub items
            $fldr_ctr = $retArray[$i]->getSubNodeCount();
            // Let's open our table
            jzTableOpen("100", "0", "jz_col_table");
            jzTROpen("jz_col_table_tr");
            // Let's see if they are only a viewing user or not
            if ($_SESSION['jz_access_level'] != "viewonly" and $_SESSION['jz_access_level'] != "lofi") {
                // Now let's show them the info button
                if ($info_level == "all" or $info_level == "admin" and $_SESSION['jz_access_level'] == "admin") {
                    jzTDOpen("1", "left", "top", "", "0");
                    $item_url = $root_dir . '/popup.php?type=' . $hierarchy[$retArray[$i]->getLevel()] . '&info=' . urlencode($retArray[$i]->getPath("String")) . '&cur_theme=' . $_SESSION['cur_theme'];
                    jzHREF($item_url, "_blank", "jz_col_table_href", "openPopup(this, 320, 520, false, 'Popup'); return false;", $img_more);
                    jzTDClose();
                }
                // Now let's see if they only wanted to see track plays
                if ($track_play_only != "true") {
                    jzTDOpen("1", "left", "top", "", "0");
                    $display->playButton($retArray[$i]);
                    jzTDClose();
                }
                // Now let's see if they wanted to see random icons
                if ($disable_random == "false") {
                    jzTDOpen("1", "left", "top", "", "0");
                    $display->randomPlayButton($retArray[$i]);
                    jzTDClose();
                }
                // Now let's show them the rating link, if they wanted it
                if ($enable_ratings == "true") {
                    jzTDOpen("1", "left", "top", "", "0");
                    $display->rateButton($retArray[$i]);
                    jzTDClose();
                }
                if ($enable_discussion == "true") {
                    jzTDOpen("1", "left", "top", "", "0");
                    $item_url = $root_dir . '/popup.php?type=discuss&info=' . rawurlencode($retArray[$i]->getPath("String")) . '&cur_theme=' . $_SESSION['cur_theme'];
                    // Now let's figure out which icon to use
                    if ($retArray[$i]->getDiscussion() == "") {
                        $img = $img_discuss_dis;
                    } else {
                        $img = $img_discuss;
                    }
                    jzHREF($item_url, "_blank", "", "openPopup(this, 500, 500, false, 'Popup'); return false;", $img_discuss);
                    jzTDClose();
                }
            } else {
                // Ok, they are view only, so let's show them the disabled icons
                jzTDOpen("1", "left", "top", "", "0");
                echo $img_more_dis;
                jzTDClose();
                jzTDOpen("1", "left", "top", "", "0");
                echo $img_play_dis;
                jzTDClose();
                if ($disable_random == "false") {
                    jzTDOpen("1", "left", "top", "", "0");
                    echo $img_random_play_dis;
                    jzTDClose();
                }
            }
            // Let's give them the check box for the playlist addition IF they wanted it
            if ($show_all_checkboxes == "true" and $enable_playlist != "false") {
                jzTDOpen("1", "left", "top", "", "0");
                echo '<input class="jz_checkbox" name="track-' . $i . '" type=checkbox value="' . $root_dir . $media_dir . '/' . rawurlencode($genre) . '/' . urlencode($retArray[$i]) . '/">';
                jzTDClose();
            }
            // NEW BACKEND: This part will need a bit more work.
            jzTDOpen("1", "left", "top", "", "0");
            echo "&nbsp;";
            jzTDClose();
            // Let's see if the data is new or not
            $new_data = "";
            $new_from = "";
            if ($new_from != "") {
                $new_data = "";
            }
            jzTDOpen("90", "left", "top", "", "0");
            $item_url = $this_page . $url_seperator . 'path=' . rawurlencode($retArray[$i]->getPath("String"));
            // Now let's display the link
            $display->link($retArray[$i]);
            // Let's see if this is new or not
            if ($new_from != "") {
                echo icon('new') . $new_data . '>';
            }
            // Now let's see if they wanted ratings
            if ($enable_ratings == "true") {
                // Ok, now let's see if there is a rating file
                //$display->rateButton($node);// NEW BACKEND: this needs work.
            }
            // Now let's return the description
            $descData = $retArray[$i]->getShortDescription();
            if ($descData) {
                echo "<br>" . stripslashes($descData) . "<br><br>";
            }
            // Now let's close out
            jzTDClose();
            jzTRClose();
            jzTableClose();
            // Now let's increment for out column counting
            if ($ctr == $folder_per_column) {
                $ctr = 1;
            } else {
                $ctr++;
            }
        }
    }
    // go to next loop
    echo '</form>';
    // Now let's set a hidden form field so we'll know how many boxes there were
    echo '<input type="hidden" name="numboxes" value="' . $i . '">';
    // Now let's close our table
    jzTableClose();
    echo "<br>\n";
    $blocks->blockBodyClose();
    // Now let's see if we should display random albums
    if ($random_albums != "0") {
        $blocks->classicRandomAlbums($node, $node->getName());
        echo "<br>";
    }
    // we might still have tracks.
    $tracks = $node->getSubNodes("tracks");
    $blocks->trackTable($tracks, false);
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //
    // Need to update this to new abstraction layer
    //
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    // Now let's look and see if there are any songs in this directory that we need to display
    // This will also test for the chart boxes and display them
    // NEW BACKEND: This needs to be reworked. (Check array for isLeaf == ture
    //$songsFound = lookForMedia(jzstripslashes(urldecode($web_root. $root_dir. $media_dir. "/". $genre)));
    // Now let's show the playlist bar
    //if ($enable_playlist <> "false"){ displayPlaylistBar($songsFound); }
}
Example #2
0
    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, $allow_filesystem_modify, $jukebox_display, $jbArr, $include_path;
        // Let's see if they wanted to pass a title
        if (!$title) {
            $title = $site_title;
        }
        // Let's setup our objects
        $root =& new jzMediaNode();
        $display =& new jzDisplay();
        $blocks = new jzBlocks();
        ?>
			<table class="jz_header_table" width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr class="jz_header_table_tr">
					<td width="80" align="left" valign="top" class="jz_header_table_outer" >
						<table class="" width="80" cellpadding="0" style="padding:5px;" cellspacing="0" border="0">
							<tr class="jz_header_table_tr">
								<td width="80" align="left" valign="top" class="" >
									<nobr>
									<?php 
        // Now let's make sure they can see this
        if ($jzUSER->getSetting("view") === true) {
            // Let's display the home icon
            $display->homeButton();
            // Let's setup the link for the help docs IF they have access to it
            if ($help_access == $_SESSION['jz_access_level'] or $help_access == "all") {
                $item_url = $root_dir . '/docs/' . $jz_lang_file . '/index.html';
                ?>
											<a href="<?php 
                echo $item_url;
                ?>
" onClick="openPopup(this, 500, 500, false, 'Help'); return false;" target="_blank"><?php 
                echo $img_more;
                ?>
</a>
											<?php 
            }
            // Now let's show them the Slimzora popup
            if ($show_slimzora && $jzUSER->getSetting('view') !== false) {
                $display->popupLink("slimzora");
            }
        } else {
            echo "&nbsp;";
        }
        if (checkPermission($jzUSER, "play")) {
            echo '&nbsp';
            $display->popupLink('plmanager');
        }
        // Now let's see if they get the tools menu
        if ($_SESSION['jz_access_level'] == "admin") {
            global $skin, $jz_MenuItemLeft, $jz_MenuSplit, $jz_MenuItemHover, $jz_MainItemHover, $main_img_dir, $jz_MenuItem;
            //include_once($web_root. $root_dir. '/lib/menu/tools-menu.php');
        }
        ?>
								</nobr>
								</td>
							</tr>
						</table>
					</td>
					<td width="100%" valign="top" class="jz_header_table_outer">
						<table width="100%" class="jz_header_table" border="0" cellpadding="0" cellspacing="0" style="padding:5px;">
							<tr class="jz_header_table_tr">
								<td width="50%" valign="top" class="jz_header_table_td">
									<?php 
        // Now let's set the header text
        if ($_SESSION['jz_access_level'] != "noaccess") {
            echo '<span class="jz_headerTitle">' . jzstripslashes($title) . '</span>';
        }
        // Now let's show the rating
        if ($enable_ratings == "true" and $ratingItem != "") {
            echo "&nbsp;" . displayRating($ratingItem, false);
        }
        // Now let's make sure they deleted the "install" directory
        if (is_dir($include_path . "install") and !is_dir($include_path . "CVS")) {
            echo "<br><br><strong>";
            echo word("You're Jinzora installation is NOT secure!!!  You need to delete the 'install' directory to secure your installation!!! - Once you delete the 'install' directory this message will go away");
            echo "</strong><br>";
        }
        // Let's see if there is a file that we want to put in the header here
        //echo returnHeaderText();
        ?>
								</td>
								<td width="50%" valign="top" class="jz_header_table_td" align="right">
									<div align="right">
									
									<?php 
        $display->loginLink();
        echo " | ";
        // Let's see if the user has logged in, and if not let's show that link
        if ($jzUSER->getSetting('admin') and $allow_filesystem_modify == "true") {
            $url_array = array();
            $url_array['jz_path'] = $node->getPath("String");
            $url_array['action'] = "popup";
            $url_array['ptype'] = "uploadmedia";
            echo '<a class="jz_header_table_href" onClick="openPopup(' . "'" . urlize($url_array) . "'" . ',450,400); return false;" href="javascript:;">' . word("Add Media") . '</a> | ';
        }
        if (false !== $display->popupLink("preferences", word("Preferences"))) {
            echo ' | ';
        }
        // Now let's show them the search box
        if ($_SESSION['jz_access_level'] != "noaccess" and $_SESSION['jz_access_level'] != "viewonly" and $_SESSION['jz_access_level'] != "lofi" and $enable_search != "false") {
            $url = array();
            $url['action'] = 'powersearch';
            echo "<a href=\"" . urlize($url) . "\" class=\"jz_header_table_href\">" . word("Search") . "</a>";
            // Now let's see if there is a value for the box
            $value = "";
            if (isset($_POST['search_query'])) {
                $value = $_POST['search_query'];
            }
            if (isset($_GET['song_title'])) {
                $value = $_GET['song_title'];
            }
            ?>
										<?php 
            $onSubmit = "";
            if ($jukebox == "true" && !defined('NO_AJAX_JUKEBOX')) {
                $onSubmit = 'onSubmit="return searchKeywords(this,\'' . htmlentities($this_page) . '\');"';
            }
            if ($cms_mode == "true") {
                $method = "GET";
            } else {
                $method = "POST";
            }
            ?>
										  
											<form action="<?php 
            echo $this_page;
            ?>
" method="<?php 
            echo $method;
            ?>
" name="searchForm" <?php 
            echo $onSubmit;
            ?>
>
											<?php 
            foreach (getURLVars($this_page) as $key => $val) {
                echo '<input type="hidden" name="' . htmlentities($key) . '" value="' . htmlentities($value) . '">';
            }
            ?>
											<input class="jz_input" type="text" name="search_query" size="15" value="<?php 
            echo $value;
            ?>
">
											<select class="jz_select" name="search_type">
												<option value="ALL">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="hidden" name="doSearch" value="true">
											<input class="jz_submit" type="submit" name="doSearch" value="<?php 
            echo word("Go");
            ?>
">
											</form>
											</nobr>
										<?php 
        }
        // Let's show them the up arrow, unless they are viewing the first page
        ?>
										<table width="100%" cellpadding="0"><tr><td width="100%" align="right"><div align="right"><nobr>
										   <?php 
        $bcrumbs = $blocks->breadCrumbs();
        // Now let's display the header for the block
        $title = "Browse";
        if ($node->getName() != "") {
            $parent = $node->getParent();
            if ($parent->getName() != "") {
                $title .= " :: " . $parent->getName();
            }
            $title .= " :: " . $node->getName();
        }
        echo $bcrumbs;
        ?>
										</nobr></div></td></tr></table>
										<?php 
        ?>
								</div>
								</td>
							</tr>
						</table>
						<?php 
        // Now, do they want to display where the other users are?
        if ($user_tracking_display == "true") {
            // Now do they only want admins to see this?
            if ($user_tracking_admin_only == "true") {
                if ($_SESSION['jz_access_level'] == "admin") {
                    displayUserTracking();
                }
            } else {
                displayUserTracking();
            }
        }
        ?>
						</td>
					</tr>
				<?php 
        // Now let's see if they are in Jukebox mode, but are NOT an admin they can only stream
        if (checkPermission($jzUSER, "jukebox_queue") && $jukebox_display != "small" && $jukebox_display != "off") {
            jzTableClose();
            echo '<div id="jukebox">' . "\n";
            $blocks->jukeboxBlock();
            echo '</div>', "\n";
            jzTableOpen("100", "0", "jz_header_table");
        }
        // Let's see if they wanted to turn the drop down boxes off
        if ($header_drops == "true") {
            ?>
					<tr class="jz_header_table_tr">
						<td width="100%" align="right" valign="top" class="jz_header_table_outer" colspan="2" style="padding:5px;">
							<table width="100%" cellpadding="0" cellspacing="0" border="0">
								<tr class="jz_header_table_tr">
								<?php 
            if (checkPermission($jzUSER, "jukebox_queue") && ($jukebox_display == "small" or $jukebox_display == "minimal")) {
                ?>
					     <td width="15%" valign="top" class="jz_header_table_td"><div id="smallJukebox">
					     <?php 
                $blocks->smallJukebox(false, 'top');
                ?>
					     
					     </div></td>
					     <?php 
            }
            // Let's make sure they wanted to see the Genre drop down
            if ($genre_drop != "false" && distanceTo("genre") !== false) {
                ?>
											<td width="15%" valign="top" class="jz_header_table_td">
												<?php 
                $display->popupLink("genre");
                ?>
										<br>
										<?php 
                if ($genre_drop == "true") {
                    ?>
										  <form action="<?php 
                    echo $this_page;
                    ?>
" method="GET">
										     <?php 
                    $display->hiddenPageVars();
                    $display->dropdown("genre");
                    ?>
												</form>
												    <?php 
                }
                ?>
											</td>
										<?php 
            }
            // Let's see if they are looking at 2 levels or 3 and show them the artists select box
            if ($artist_drop != "false" && distanceTo("artist") !== false) {
                ?>
											<td width="15%" valign="top" class="jz_header_table_td">
												<?php 
                $display->popupLink("artist");
                ?>
											   <br><?php 
                if ($artist_drop == "true") {
                    ?>
												<form action="<?php 
                    echo $this_page;
                    ?>
" method="GET">
												<?php 
                    $display->hiddenPageVars();
                    $display->dropdown("artist");
                    ?>
												</form> <?php 
                }
                ?>
											</td>
										<?php 
            }
            // Let's see if they are looking at 2 levels or 3 and show them the artists select box
            if ($album_drop != "false" && distanceTo("album") !== false) {
                ?>
											<td width="15%" valign="top" class="jz_header_table_td">
												<?php 
                $display->popupLink("album");
                ?>
											   <br><?php 
                if ($album_drop == "true") {
                    ?>
												<form action="<?php 
                    echo $this_page;
                    ?>
" method="GET">
												<?php 
                    $display->hiddenPageVars();
                    $display->dropdown("album");
                    ?>
												</form><?php 
                }
                ?>
											</td>
										<?php 
            }
            if ($song_drop != "false") {
                ?>
											<td width="15%" valign="top" class="jz_header_table_td">
												<?php 
                $display->popupLink("track");
                ?>
											   <br><?php 
                if ($song_drop == "true") {
                    ?>
												<form action="<?php 
                    echo $this_page;
                    ?>
" method="GET">
												<?php 
                    $display->hiddenPageVars();
                    $display->dropdown("track");
                    ?>
												</form><?php 
                }
                ?>
											</td>
										<?php 
            }
            // Now let's display the random playlist generator
            if ($quick_drop == "true" and $_SESSION['jz_access_level'] != "viewonly" and $_SESSION['jz_access_level'] != "lofi") {
                jzTDOpen("15", "left", "top", "jz_header_table_td", "0");
                echo '<nobr>';
                $blocks->randomGenerateSelector($node);
                echo '</nobr>';
                jzTDClose();
            }
            // Now let's display the resampler
            if ($display->wantResampleDropdown($node)) {
                jzTDOpen("10", "left", "top", "jz_header_table_td", "0");
                $display->displayResampleDropdown($node);
                jzTDClose();
            }
            jzTRClose();
            // Now let's close out
            jzTableClose();
            jzTDClose();
            jzTRClose();
        }
        // This closes our big table above
        jzTableClose();
    }