Ejemplo n.º 1
0
 function standardPage(&$node)
 {
     global $show_artist_alpha, $truncate_length, $sort_by_year, $jzSERVICES;
     // Let's setup the objects
     $blocks =& new jzBlocks();
     $display =& new jzDisplay();
     $smarty = smartySetup();
     $itemArray = getCurNodeList();
     $smarty->assign("nodes", $itemArray);
     // Now are there any tracks?
     // Probably handle this differently:
     // change getCurNodeList to getCurMediaList.
     $tracks = $node->getSubNodes("tracks");
     if (count($tracks) != 0) {
         $smary->assign("tracks", array());
     }
     $smarty->assign("playerURL", urlize(array("frame" => "player")));
     $smarty->assign("bodyURL", urlize(array("frame" => "body")));
     // OUTPUT HTML
     // Is this our first pageview?
     if ((!isset($_GET['refview']) || $_GET['refview'] != $this->name) && !isset($_GET['frame'])) {
         $display->preheader();
         $smarty->assign("playerHeight", $jzSERVICES->returnPlayerHeight());
         jzTemplate($smarty, "page");
     } else {
         if (isset($_GET['frame']) && $_GET['frame'] == "player") {
             $display->preheader();
             jzTemplate($smarty, "player");
         } else {
             $display->preheader();
             jzTemplate($smarty, "body");
         }
     }
 }
Ejemplo n.º 2
0
function mklink($l)
{
    global $arr;
    $arr['jz_level'] = distanceTo("artist");
    $arr['jz_letter'] = $l;
    return urlize($arr);
}
Ejemplo n.º 3
0
function drawPage($node)
{
    global $random_albums, $include_path;
    $display = new jzDisplay();
    $blocks = new jzBlocks();
    echo '<br>';
    $blocks->blockBodyOpen();
    if (isset($_GET['letter'])) {
        $nodes = $node->getAlphabetical($_GET['letter'], 'nodes', 2);
    } else {
        $nodes = $node->getSubNodes('nodes');
    }
    $tracks = $node->getSubNodes('tracks');
    // Now let's display the site description
    $news = $blocks->siteNews($node);
    if ($news != "") {
        echo "<br><center>" . $news . "<center>";
    }
    $cols = 4;
    $curCol = 1;
    $per_col = round(sizeof($nodes) / $cols);
    $i = 0;
    $percent = round(100 / $cols);
    echo "<table cellpadding=\"4\" width=\"100%\"><tr class=\"jz_col_table_tr\"><td class=\"jz_col_table\" valign=\"top\" width=\"{$percent}%\"><table>";
    foreach ($nodes as $el) {
        if ($i == $per_col && $curCol != $cols) {
            $curCol++;
            echo "</table></td><td class=\"jz_col_table\" valign=\"top\" width=\"{$percent}%\"><table width=\"100%\">";
            $i = 0;
        }
        echo "<tr><td>";
        $display->link($el);
        echo "</td></tr>";
        $i++;
    }
    echo "</table></td></tr></table>";
    if (!isset($_GET['letter'])) {
        $url = array();
        $url['letter'] = '#';
        echo "| <a href=\"" . urlize($url) . "\">#</a>";
        for ($let = 'A'; $let != 'Z'; $let++) {
            $url['letter'] = $let;
            echo " | <a href=\"" . urlize($url) . "\">" . $let . "</a>";
        }
        $url['letter'] = "*";
        echo " | <a href=\"" . urlize($url) . "\">ALL</a> |";
        echo "<br>";
        if (sizeof($tracks) > 0) {
            $blocks->trackTable($tracks, false, true);
        }
        if ($random_albums != "0") {
            echo "<br>";
            $blocks->randomAlbums($node, $node->getName());
        }
    }
    $blocks->blockBodyClose();
    echo "<br>";
}
Ejemplo n.º 4
0
 function scrape()
 {
     global $RolesGraph;
     parse_str(parse_url($this->pageUri, PHP_URL_QUERY), $pageQueryParams);
     $personID = $pageQueryParams['personID'];
     if (@(!($node = $this->xpath->query('//tr/td/h3')->item(0)))) {
         $this->log_message("couldn't find name for Person");
         return null;
     }
     $name = $node->nodeValue;
     $uri = WHOISWHO . 'people/' . $personID . '/' . urlize($name);
     if (preg_match('/^([\\p{Lu} ´\\-’\'"ß\\(\\)]+) ([\\p{L} \\-’\'\\."´š]+)$/u', $name, $matches)) {
         $surname = ucwords(strtolower($matches[1]));
         $fullName = trim($matches[2]) . ' ' . $surname;
         $this->graph->add_literal_triple($uri, FOAF . 'familyName', $surname);
     } else {
         $this->log_message("Name doesn't match regular expression\t" . $name);
         $fullName = $name;
     }
     $this->add_resource($uri, FOAF . 'Person', $fullName);
     $this->graph->add_literal_triple($uri, FOAF . 'name', $fullName);
     $this->graph->add_resource_triple($uri, FOAF . 'isPrimaryTopicOf', $this->pageUri);
     $address = '';
     foreach ($this->xpath->query('//tr/td[contains(. ,"Tel:")][preceding::h3]/node()') as $node) {
         $address .= $this->parseAddressDetails($node, $uri);
     }
     if (!empty($address)) {
         $this->graph->add_literal_triple($uri, OV . 'postalAddress', trim($address));
     }
     $rolePositions = array();
     foreach ($this->xpath->query(WHOISWHO_ROLE_XPATH) as $a) {
         $orgBreadcrumbPath = $a->nodeValue;
         $roleLabels = $this->getRoleLabelsFromNode($a);
         foreach ($roleLabels as $role_label) {
             $roleSlug = urlize($role_label);
             $roleURI = WHOISWHO . 'roles/' . $roleSlug;
             $rolePositions[] = $roleURI;
             $orgNodeID = $this->getNodeIdFromUrl($a->getAttribute('href'));
             $orgURI = INST . 'institutions/' . $orgNodeID;
             $membershipURI = $orgURI . '/memberships/' . $personID . '/' . $roleSlug;
             $RolesGraph->add_resource_triple($roleURI, RDF_TYPE, ORG . 'Role');
             $RolesGraph->add_literal_triple($roleURI, RDFS_LABEL, $role_label, 'en');
             $this->add_resource($membershipURI, ORG . 'Membership', $fullName . ', ' . $role_label . ' of ' . array_pop(explode('; ', $orgBreadcrumbPath)), 'en-gb');
             $this->graph->add_resource_triple($membershipURI, ORG . 'member', $uri);
             $this->graph->add_resource_triple($membershipURI, ORG . 'organization', $orgURI);
             $this->graph->add_resource_triple($membershipURI, ORG . 'role', $roleURI);
             $this->graph->add_resource_triple($uri, ORG . 'memberOf', $orgURI);
         }
     }
     foreach ($this->translate_langs as $lang) {
         $this->translateRolesTo($rolePositions, $lang, $RolesGraph);
     }
     //file_put_contents('roles.nt', $RolesGraph->to_ntriples());
     $this->flushNtriples();
 }
Ejemplo n.º 5
0
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');
}
Ejemplo n.º 6
0
function doTemplate($node)
{
    global $jbArr, $jzUSER;
    $display =& new jzDisplay();
    $smarty = mobileSmarty();
    $smarty->assign('Playback', word('Playback'));
    $smarty->assign('SendToDevice', word('Send to Device:'));
    $smarty->assign('AddToPlaylist', word('Add to Playlist:'));
    $path = $node->getPath("String");
    $url = array('jz_path' => $path, 'page' => 'settings');
    $pbt = array();
    $playlists = array();
    $url['jz_player'] = 'stream';
    $url['jz_player_type'] = 'stream';
    $selected = !actionIsQueue() && checkPlayback() == 'stream';
    $pbt[] = array('label' => word('Stream media'), 'url' => urlize($url), 'selected' => $selected);
    $url['jz_player_type'] = 'jukebox';
    if (isset($jbArr) && is_array($jbArr)) {
        for ($i = 0; $i < sizeof($jbArr); $i++) {
            $url['jz_player'] = $i;
            $url['jz_player_type'] = 'jukebox';
            $selected = !actionIsQueue() && checkPlayback() == 'jukebox' && $_SESSION['jb_id'] == $i;
            $pbt[] = array('label' => word('Send to %s', $jbArr[$i]['description']), 'url' => urlize($url), 'selected' => $selected);
        }
    }
    $smarty->assign('devices', $pbt);
    /* playlists */
    $url['jz_player_type'] = 'playlist';
    $url['jz_player'] = 'session';
    $selected = actionIsQueue() && $_SESSION['jz_playlist_queue'] == 'session';
    $playlists[] = array('label' => word('Quick List'), 'url' => urlize($url), 'selected' => $selected);
    $lists = $jzUSER->listPlaylists("static");
    foreach ($lists as $id => $plName) {
        $url['jz_player'] = $id;
        $selected = actionIsQueue() && $_SESSION['jz_playlist_queue'] == $id;
        $playlists[] = array('label' => $plName, 'url' => urlize($url), 'selected' => $selected);
    }
    $smarty->assign('playlists', $playlists);
    $url['jz_player'] = 'new';
    $smarty->assign('newList', array('href' => '#', 'onclick' => "window.location='" . urlize($url) . "'.concat('&playlistname='.concat(document.getElementById('playlistname').value)); return true;", 'name' => word('My Playlist'), 'inputID' => word('playlistname'), 'label' => word('New list:'), 'selected' => false));
    jzTemplate($smarty, 'settings');
}
Ejemplo n.º 7
0
function smartyNode($e)
{
    global $compare_ignores_the;
    static $anchor = 'A';
    $display = new jzDisplay();
    $arr = array();
    $arr['name'] = $e->getName();
    $arr['link'] = urlize(array('jz_path' => $e->getPath("String")));
    if ($e->getPType() == "album" || $e->getPType == "disk") {
        if (isset($_SESSION['jz_playlist_queue'])) {
            $arr['openPlayTag'] = $display->getOpenAddToListTag($e);
        } else {
            $arr['openPlayTag'] = $display->getOpenPlayTag($e);
        }
    } else {
        if (actionIsQueue()) {
            $arr['openPlayTag'] = $display->getOpenAddToListTag($e);
        } else {
            $arr['openPlayTag'] = $display->getOpenPlayTag($e, true, 50);
        }
    }
    $compName = $arr['name'];
    if ($compare_ignores_the == "true" && strtoupper(substr($compName, 0, 4)) == 'THE ') {
        $compName = substr($compName, 4);
    }
    $compName = trim($compName);
    $anchors = array();
    if ($i == 0) {
        $anchors[] = 'anchor_NUM';
        $first = false;
    }
    while (strlen($anchor) == 1 && ($anchor < strtoupper($compName) || $i == sizeof($items) - 1)) {
        $anchors[] = 'anchor_' . $anchor++;
    }
    $arr['anchors'] = $anchors;
    return $arr;
}
Ejemplo n.º 8
0
/** 
 * 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;
}
Ejemplo n.º 9
0
		<?php 
flushdisplay();
$display = new jzDisplay();
$this->displayPageTop("", "Searching for art for: " . $node->getName());
$this->openBlock();
echo word('Searching, please wait...') . "<br><br>";
flushdisplay();
// Now let's display what we got
$i = 0;
echo "<center>";
// Let's setup our form
$arr = array();
$arr['action'] = "popup";
$arr['ptype'] = "getalbumart";
$arr['jz_path'] = $node->getPath('String');
echo '<form action="' . urlize($arr) . '" method="POST">';
$i = 0;
// Ok, now let's setup a service to get the art for each of the providers
// Now let's get a link from Amazon
$jzService = new jzServices();
$jzService->loadService("metadata", "amazon");
$image = $jzService->getAlbumMetadata($node, false, "image");
if (strlen($image) != 0) {
    echo '<img src="' . $image . '" border="0"><br>';
    echo $display->returnImageDimensions($image);
    echo '<br><br>';
    echo '<input type="hidden" value="' . $image . '" name="edit_image_' . $i . '">';
    echo '<input type="submit" name="edit_download_' . $i . '" value="' . word('Download') . '" class="jz_submit"><br><br><br>';
    $i++;
}
flushdisplay();
Ejemplo n.º 10
0
$title = $node->getName();
if ($title == "") {
    $title = word("Root Level");
}
$this->displayPageTop("", "Scanning for new media in: " . $title);
$this->openBlock();
// Let's show them the form
if (!isset($_POST['edit_scan_now'])) {
    $url_array = array();
    $url_array['action'] = "popup";
    $url_array['ptype'] = "scanformedia";
    $url_array['jz_path'] = $_GET['jz_path'];
    $i = 0;
    ?>
			<form action="<?php 
    echo urlize($url_array);
    ?>
" method="post">
			   <?php 
    if (!($backend == "id3-cache" || $backend == "id3-database")) {
        ?>
				<input name="edit_scan_where" value="only" checked type="radio"> <?php 
        echo word("This level only");
        ?>
<br>
				<input name="edit_scan_where" value="all" type="radio"> <?php 
        echo word("All sub items (can be very slow)");
        ?>
<br><br>
			     <?php 
    } else {
Ejemplo n.º 11
0
 /**
  * Gets a playable link for this playlist.
  * @author Ben Dodson
  * @since 1/3/08
  **/
 function getPlayHREF($random = false, $limit = 0)
 {
     global $jzUSER;
     // do they have permissions or should we just do text?
     // return null otherwise
     $arr = array();
     $arr['type'] = 'playlist';
     $arr['jz_pl_id'] = $this->getID();
     $arr['action'] = "playlist";
     if ($limit != 0) {
         $arr['limit'] = $limit;
     }
     if ($random) {
         $arr['mode'] = "random";
     }
     if ($clips) {
         $arr['clips'] = "true";
     }
     if (isset($_GET['frame'])) {
         $arr['frame'] = $_GET['frame'];
     }
     if (false !== strpos($_SERVER['PHP_SELF'], 'api.php')) {
         $arr['target'] = 'raw';
     }
     if (isset($_REQUEST['user'])) {
         $arr['user'] = $_REQUEST['user'];
     }
     if (isset($_REQUEST['pass'])) {
         $arr['pass'] = $_REQUEST['pass'];
     }
     if (isset($_REQUEST['pw_hashed'])) {
         $arr['pw_hashed'] = $_REQUEST['pw_hashed'];
     }
     return urlize($arr);
 }
    $array[$i]['active'] = $row['active'];
    $array[$i]['img'] = $row['img'];
    $array[$i]['flag_featured'] = $row['flag_featured'];
    $array[$i]['date_created'] = $row['date_created'];
    $i++;
}
$x = 0;
while ($x < count($array)) {
    ?>

<div class="col-xs-6 col-sm-6 col-md-3">
    <div class="product-image-wrapper">
		<div class="single-products">
	       	<div class="productinfo text-center">
		      	<a href="product-details.php?name=<?php 
    echo urlize($array[$x]['name']);
    ?>
"><img src="uploads/<?php 
    echo explode('.', $array[$x]['img'])[0] . '_th.' . explode('.', $array[$x]['img'])[1];
    ?>
" alt="<?php 
    echo $array[$x]['name'];
    ?>
" /></a>
				<p><?php 
    echo $array[$x]['description'];
    ?>
</p>
			</div>
		</div>
    </div>
Ejemplo n.º 13
0
function userManSettings($purpose, $settings = false, $subaction = false, $post = false)
{
    global $jzSERVICES, $resampleRates, $include_path;
    $be = new jzBackend();
    $display = new jzDisplay();
    $url_array = array();
    $url_array['action'] = "popup";
    $url_array['ptype'] = "usermanager";
    if ($subaction === false) {
        $url_array['subaction'] = "handleclass";
    } else {
        $url_array['subaction'] = $subaction;
    }
    // Why PHP pisses me off.
    foreach ($settings as $k => $v) {
        if ($v == "true") {
            $settings[$k] = true;
        } else {
            if ($v == "false") {
                $settings[$k] = false;
            } else {
                $settings[$k] = $v;
            }
        }
    }
    ?>
      <form method="POST" action="<?php 
    echo urlize($url_array);
    ?>
">
	 <input type="hidden" name="update_settings" value="true">
	 <?php 
    if (is_array($post)) {
        foreach ($post as $p => $v) {
            echo '<input type="hidden" name="' . $p . '" value="' . $v . '">';
        }
    }
    ?>
	 <table>
	 <?php 
    if ($purpose != "custom") {
        ?>
	 <tr><td width="30%" valign="top" align="right">
	 <?php 
        echo word("Template:");
        ?>
	 </td><td width="70%">
	     <?php 
        if ($purpose == "new") {
            ?>
	       <input name="classname" class="jz_input">
	       <?php 
        } else {
            if ($purpose == "update") {
                echo '<input type="hidden" name="classname" class="jz_input" value="' . $_POST['classname'] . '">';
                echo $_POST['classname'];
            }
        }
        ?>
	     </td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr>
					   <?php 
    }
    ?>
							<tr>
							<td width="30%" valign="top" align="right">
							<?php 
    echo word("Interface");
    ?>
:
	       </td>
		   <td width="70%">
		   <?php 
    $overCode = $display->returnToolTip(word("INTERFACE_NOTE"), word("Default Interface"));
    ?>
		   <select <?php 
    echo $overCode;
    ?>
 name="usr_interface" class="jz_select" style="width:135px;">
			 <?php 
    // Let's get all the interfaces
    $retArray = readDirInfo($include_path . "frontend/frontends", "dir");
    sort($retArray);
    for ($i = 0; $i < count($retArray); $i++) {
        echo '<option ';
        if ($settings['frontend'] == $retArray[$i]) {
            echo 'selected ';
        }
        echo 'value="' . $retArray[$i] . '">' . $retArray[$i] . '</option>' . "\n";
    }
    ?>
			</select>
			</td>
			</tr>
			<tr>
			<td width="30%" valign="top" align="right">
			<?php 
    echo word("Theme");
    ?>
:
			</td>
			<td width="70%">
			<?php 
    $overCode = $display->returnToolTip(word("THEME_NOTE"), word("Default Theme"));
    ?>
			<select <?php 
    echo $overCode;
    ?>
 name="usr_theme" class="jz_select" style="width:135px;">
			<?php 
    // Let's get all the interfaces
    $retArray = readDirInfo($include_path . "style", "dir");
    sort($retArray);
    for ($i = 0; $i < count($retArray); $i++) {
        if ($retArray[$i] == "images") {
            continue;
        }
        echo '<option ';
        if ($settings['theme'] == $retArray[$i]) {
            echo 'selected ';
        }
        echo 'value="' . $retArray[$i] . '">' . $retArray[$i] . '</option>' . "\n";
    }
    ?>
			</select>
			</td>
			</tr>
			<tr>
			<td width="30%" valign="top" align="right">
			<?php 
    echo word("Language");
    ?>
:
			</td>
			<td width="70%">
			<?php 
    $overCode = $display->returnToolTip(word("LANGUAGE_NOTE"), word("Default Language"));
    ?>
			<select <?php 
    echo $overCode;
    ?>
 name="usr_language" class="jz_select" style="width:135px;">
			<?php 
    // Let's get all the interfaces
    $languages = getLanguageList();
    for ($i = 0; $i < count($languages); $i++) {
        echo '<option ';
        if ($languages[$i] == $settings['language']) {
            echo ' selected ';
        }
        echo 'value="' . $languages[$i] . '">' . $languages[$i] . '</option>' . "\n";
    }
    ?>
							</select>
							    </td>
							    </tr>
							    <tr>
							    <td width="30%" valign="top" align="right">
							    <?php 
    echo word("Home Directory");
    ?>
:
							  </td>
							    <td width="70%">
								<?php 
    $overCode = $display->returnToolTip(word("HOMEDIR_NOTE"), word("User Home Directory"));
    ?>
							    <input <?php 
    echo $overCode;
    ?>
 type="input" name="home_dir" class="jz_input" value="<?php 
    echo $settings['home_dir'];
    ?>
">
							    </td>
							    </tr>
							    <tr>
							    <td width="30%" valign="middle" align="right">
							    <?php 
    echo word("Home Permissions");
    ?>
:
							  </td>
							    <td width="70%">
							    <br>
								<?php 
    $overCode = $display->returnToolTip(word("HOMEREAD_NOTE"), word("Read Home Directory"));
    $overCode2 = $display->returnToolTip(word("HOMEADMIN_NOTE"), word("Admin Home Directory"));
    $overCode3 = $display->returnToolTip(word("HOMEUPLOAD_NOTE"), word("Home Directory Upload"));
    ?>
							    <input <?php 
    echo $overCode;
    ?>
 type="checkbox" name="home_read" class="jz_input" <?php 
    if ($settings['home_read'] == true) {
        echo 'CHECKED';
    }
    ?>
> Read only from home directory<br>
							    <input <?php 
    echo $overCode2;
    ?>
 type="checkbox" name="home_admin" class="jz_input" <?php 
    if ($settings['home_admin'] == true) {
        echo 'CHECKED';
    }
    ?>
> Home directory admin<br>
							    <input <?php 
    echo $overCode3;
    ?>
 type="checkbox" name="home_upload" class="jz_input" <?php 
    if ($settings['home_upload'] == true) {
        echo 'CHECKED';
    }
    ?>
> Upload to home directory
							    <br><br>
							    </td>
							    </tr>
							    
							    <tr>
							    <td width="30%" valign="middle" align="right">
							    <?php 
    echo word("User Rights");
    ?>
:
							  </td>
							    <td width="70%">
								<?php 
    $overCode = $display->returnToolTip(word("VIEW_NOTE"), word("User can view media"));
    $overCode2 = $display->returnToolTip(word("STREAM_NOTE"), word("User can stream media"));
    $overCode3 = $display->returnToolTip(word("LOFI_NOTE"), word("User can access lo-fi tracks"));
    $overCode4 = $display->returnToolTip(word("DOWNLOAD_NOTE"), word("User can download"));
    $overCode5 = $display->returnToolTip(word("POWERSEARCH_NOTE"), word("User can power search"));
    $overCode6 = $display->returnToolTip(word("JUKEBOXQ_NOTE"), word("User can queue jukebox"));
    $overCode7 = $display->returnToolTip(word("JUKEBOXADMIN_NOTE"), word("User can admin jukebox"));
    $overCode8 = $display->returnToolTip(word("SITE_NOTE"), word("Site Admin"));
    $overCode9 = $display->returnToolTip(word("EDIT_NOTE"), word("Edit Preferences"));
    $overCode10 = $display->returnToolTip(word("FORCE_CLIPS_NOTE"), word("Force clip mode"));
    ?>
							    <input <?php 
    echo $overCode;
    ?>
 type="checkbox" name="view" class="jz_input" <?php 
    if ($settings['view'] == true) {
        echo 'CHECKED';
    }
    ?>
> View
							    <input <?php 
    echo $overCode2;
    ?>
 type="checkbox" name="stream" class="jz_input" <?php 
    if ($settings['stream'] == true) {
        echo 'CHECKED';
    }
    ?>
> Stream
							    <input <?php 
    echo $overCode3;
    ?>
 type="checkbox" name="lofi" class="jz_input" <?php 
    if ($settings['lofi'] == true) {
        echo 'CHECKED';
    }
    ?>
> Lo-Fi<br>
							    <input <?php 
    echo $overCode4;
    ?>
 type="checkbox" name="download" class="jz_input" <?php 
    if ($settings['download'] == true) {
        echo 'CHECKED';
    }
    ?>
> Download
							    <input <?php 
    echo $overCode5;
    ?>
 type="checkbox" name="powersearch" class="jz_input" <?php 
    if ($settings['powersearch'] == true) {
        echo 'CHECKED';
    }
    ?>
> Power Search<br>
							    <input <?php 
    echo $overCode6;
    ?>
 type="checkbox" name="jukebox_queue" class="jz_input" <?php 
    if ($settings['jukebox_queue'] == true) {
        echo 'CHECKED';
    }
    ?>
> Jukebox Queue
							    <input <?php 
    echo $overCode7;
    ?>
 type="checkbox" name="jukebox_admin" class="jz_input" <?php 
    if ($settings['jukebox_admin'] == true) {
        echo 'CHECKED';
    }
    ?>
> Jukebox Admin<br>
							    <input <?php 
    echo $overCode8;
    ?>
 type="checkbox" name="admin" class="jz_input" <?php 
    if ($settings['admin'] == true) {
        echo 'CHECKED';
    }
    ?>
> Site Admin
						        <input <?php 
    echo $overCode9;
    ?>
 type="checkbox" name="edit_prefs" class="jz_input" <?php 
    if ($settings['edit_prefs'] == true) {
        echo 'CHECKED';
    }
    ?>
> Edit Prefs
                                                        <input <?php 
    echo $overCode10;
    ?>
 type="checkbox" name="force_clips" class="jz_input" <?php 
    if ($settings['force_clips'] == true) {
        echo 'CHECKED';
    }
    ?>
> Clips Only
																										    <br><br>
							    </td>
							    </tr>
							    <tr>
								<td width="30%" valign="top" align="right">
							    <?php 
    echo word("Playlist Type");
    ?>
:
								</td><td width="70%">
								<?php 
    $overCode = $display->returnToolTip(word("PLAYLIST_NOTE"), word("Playlist Type"));
    ?>
								<select <?php 
    echo $overCode;
    ?>
 name="pltype" class="jz_select" style="width:135px;">
							 <?php 
    $list = $jzSERVICES->getPLTypes();
    foreach ($list as $p => $desc) {
        echo '<option value="' . $p . '"';
        if ($p == $settings['playlist_type']) {
            echo ' selected';
        }
        echo '>' . $desc . '</option>';
    }
    ?>
				    </select></td></tr>

							    <tr>
							    <td width="30%" valign="top" align="right">
							    <?php 
    echo word("Resample Rate");
    ?>
:
							  </td>
					<td width="70%">
					<?php 
    $overCode = $display->returnToolTip(word("RESAMPLE_NOTE"), word("Resample Rate"));
    $overCode2 = $display->returnToolTip(word("LOCK_NOTE"), word("Resample Rate Lock"));
    ?>
						<select <?php 
    echo $overCode;
    ?>
 name="resample" class="jz_select" style="width:50px;">
							<option value="">-</option>
							<?php 
    // Now let's create all the items based on their settings
    $reArr = explode("|", $resampleRates);
    for ($i = 0; $i < count($reArr); $i++) {
        echo '<option value="' . $reArr[$i] . '"';
        if ($settings['resample_rate'] == $reArr[$i]) {
            echo ' selected';
        }
        echo '>' . $reArr[$i] . '</option>' . "\n";
    }
    ?>
						</select> 
						    <input <?php 
    echo $overCode2;
    ?>
 type="checkbox" name="lockresample" class="jz_input" <?php 
    if ($settings['resample_lock'] == true) {
        echo 'CHECKED';
    }
    ?>
> <?php 
    echo word('Locked');
    ?>
					</td>
				</tr>
				<tr>
					<td width="30%" valign="top" align="right">
						<?php 
    echo word("External Player");
    ?>
:
					</td>
					<td width="70%">
						<?php 
    $overCode = $display->returnToolTip(word("PLAYER_NOTE"), word("External Player"));
    ?>
						<select <?php 
    echo $overCode;
    ?>
 name="player" class="jz_select" style="width:135px;">
							<option value=""> - </option>
							<?php 
    // Let's get all the interfaces
    $retArray = readDirInfo($include_path . "services/services/players", "file");
    sort($retArray);
    for ($i = 0; $i < count($retArray); $i++) {
        if (!stristr($retArray[$i], ".php") and !stristr($retArray[$i], "qt.")) {
            continue;
        }
        $val = substr($retArray[$i], 0, -4);
        echo '<option value="' . $val . '"';
        if ($settings['player'] == $val) {
            echo ' selected';
        }
        echo '>' . $val . '</option>' . "\n";
    }
    ?>
						</select>
					</td>
				</tr>
				<tr>
					<td width="30%" valign="top" align="right">
						<?php 
    echo word("Playback Limit");
    ?>
:
					</td>
					<td width="70%"><td></tr><tr><td></td><td>
					    <table><tr><td>
					    
						<?php 
    echo word("Limit:");
    echo '</td><td>';
    $overCode = $display->returnToolTip(word("Sets a streaming limit for users based on the size or number of songs played."), word("Playback Limit"));
    $cap_limit = $settings['cap_limit'];
    if (isNothing($cap_limit)) {
        $cap_limit = 0;
    }
    ?>
					        <input <?php 
    echo $overCode;
    ?>
 name="cap_limit" class="jz_select" style="width:35px;" value="<?php 
    echo $cap_limit;
    ?>
">
					</td></tr>
                                        <tr><td>					    
						<?php 
    echo word("Method:");
    echo '</td><td>';
    $overCode = $display->returnToolTip(word("Sets the method for limiting playback"), word("Limiting method"));
    $cap_method = $settings['cap_method'];
    ?>
					        <select name="cap_method" class="jz_select" <?php 
    echo $overCode;
    ?>
>
					       <option value="size"<?php 
    if ($cap_method == "size") {
        echo ' selected';
    }
    ?>
><?php 
    echo word('Size (MB)');
    ?>
</option>
					       <option value="number"<?php 
    if ($cap_method == "number") {
        echo ' selected';
    }
    ?>
><?php 
    echo word('Number');
    ?>
</option>
					</td></tr>
                                        <tr><td>
					    
						<?php 
    echo word("Duration:");
    echo '</td><td>';
    $overCode = $display->returnToolTip(word("How long the limit lasts, in days."), word("Limit duration"));
    $cap_duration = $settings['cap_duration'];
    if (isNothing($cap_duration)) {
        $cap_duration = 30;
    }
    ?>
					        <input <?php 
    echo $overCode;
    ?>
 name="cap_duration" class="jz_select" style="width:35px;" value="<?php 
    echo $cap_duration;
    ?>
">
					</td></tr>
										  </table>
				</tr>
								
				
				<tr>
					<td width="30%" valign="top">
					</td>
					<td width="70%">
					<input type="submit" name="handlUpdate" value="<?php 
    echo word("Save");
    ?>
" class="jz_submit">
					</td>
				</tr>
						    </table>
<?php 
}
Ejemplo n.º 14
0
";
		window.opener.document.getElementById("WhoIsWhereFrame").src = "<?php 
echo urlize($url);
?>
";
		-->
		</script>
		<?php 
// Let's setup the form for the user to choose from
$arr = array();
$arr['action'] = "popup";
$arr['ptype'] = "downloadtranscode";
$arr['jz_path'] = $node->getPath('String');
?>
		<form action="<?php 
echo urlize($arr);
?>
" method="POST" name="dlForm">
			<input type="hidden" name="edit_dl_filename" value="<?php 
echo $node->getDataPath('String');
?>
">
			<?php 
// Can they resample?
if ($allow_resample == "true") {
    ?>
					<strong>
					<?php 
    echo word("Original File");
    if ($node->getPType() != "track") {
        echo " (" . word("Sample") . ")";
Ejemplo n.º 15
0
<?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');
Ejemplo n.º 16
0
    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];
                ?>
">
								<td width="1%" valign="middle">
									
								</td>
								<td width="99%" valign="middle" colspan="4">
									<?php 
                if ($art) {
                    $display->link($item, $display->returnImage($art, $node->getName(), $image_size, $image_size, "limit", false, false, "left", "4", "4"));
                }
                echo $display->returnShortName($item->getDescription(), $desc_truncate);
                // Do we need the read more link?
                if (strlen($item->getDescription()) > $desc_truncate) {
                    $url_array = array();
                    $url_array['jz_path'] = $item->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>';
                }
                ?>
								</td>	
							</tr>
							<?php 
            }
            ?>
				</table>
				<table width="100%" cellspacing="0" cellpadding="0"><tr bgcolor="#D2D2D2"><td width="100%"></td></tr></table>
				<?php 
        }
        // Now are there any tracks?
        if (isset($_GET['jz_letter'])) {
            $root = new jzMediaNode();
            //$tracks = $root->getAlphabetical($_GET['jz_letter'],"tracks",-1);
            $tracks = array();
        } else {
            $tracks = $node->getSubNodes("tracks");
        }
        if (count($tracks) != 0) {
            $blocks->trackTable($tracks);
        }
        if (sizeof($nodes) > 0 || sizeof($tracks) > 0) {
            ?>
				<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="100%">
								<a style="cursor:hand" onClick="CheckBoxes('albumForm',true); return false;" href="javascript:;"><img src="<?php 
            echo $image_dir;
            ?>
check.gif" border="0"></a><a style="cursor:hand" onClick="CheckBoxes('albumForm',false); return false;" href="javascript:;"><img src="<?php 
            echo $image_dir;
            ?>
check-none.gif" border="0"></a>
									<?php 
            $display->addListButton();
            ?>
									<?php 
            $display->hiddenVariableField('action', 'mediaAction');
            ?>
									<?php 
            $display->hiddenVariableField('path', $_GET['jz_path']);
            ?>
									
									<?php 
            $url_array = array();
            $url_array['action'] = "popup";
            $url_array['ptype'] = "playlistedit";
            echo '<a href="javascript:;" onClick="openPopup(' . "'" . urlize($url_array) . "'" . ',600,600); return false;"><img src="' . $image_dir . 'playlist.gif" border="0"></a>';
            echo '&nbsp;';
            $display->playlistSelect(115, false, "all");
            ?>
						
								</form>
						</td>
					</tr>
				</table>
				<?php 
        }
        echo '</form>';
        // Now let's close out
        $this->footer($node);
    }
Ejemplo n.º 17
0
            $array[$i]['items'] = $display->link($item, $count . " " . $files, false, false, true);
        }
    }
    $array[$i]['play_button'] = $display->playButton($item, false, false, false, true);
    $array[$i]['random_button'] = $display->randomPlayButton($item, false, false, false, true);
    // Now do we hvae another row?
    $array[$i]['subitems'] = false;
    if (($art = $item->getMainArt($image_size . "x" . $image_size)) != false or ($desc = $item->getDescription()) != "") {
        $array[$i]['subitems'] = true;
        $array[$i]['art'] = false;
        if ($art) {
            $array[$i]['art'] = $display->link($item, $display->returnImage($art, $node->getName(), $image_size, $image_size, "limit", false, false, "left", "4", "4"), false, false, true);
        }
        $array[$i]['desc'] = $display->returnShortName($item->getDescription(), $desc_truncate);
        $array[$i]['read_more'] = false;
        // Do we need the read more link?
        if (strlen($item->getDescription()) > $desc_truncate) {
            $url_array = array();
            $url_array['jz_path'] = $item->getPath("String");
            $url_array['action'] = "popup";
            $url_array['ptype'] = "readmore";
            $array[$i]['read_more'] = ' <a href="' . urlize($url_array) . '" onclick="openPopup(this, 450, 450); return false;">...read more</a>';
        }
    }
    $c = 1 - $c;
    $array[$i]['row'] = $row_colors[$c];
    $i++;
}
$smarty->assign('image_dir', $image_dir);
$smarty->assign('items', $array);
jzTemplate($smarty, "standard-page");
Ejemplo n.º 18
0
            $meta['pic_name'] = $imgShortName;
        }
    }
    if ($dirtyFlag) {
        $node->bulkMetaUpdate($meta);
    }
}
$this->displayPageTop("", word("Item Information for") . ": " . $node->getName());
$this->openBlock();
$display = new jzDisplay();
// Let's setup our form
$arr = array();
$arr['action'] = "popup";
$arr['ptype'] = "iteminfo";
$arr['jz_path'] = $_GET['jz_path'];
echo '<form action="' . urlize($arr) . '" method="POST" enctype="multipart/form-data">';
// Ok, now let's see what they can edit?
$i = 0;
?>
				<table class="jz_track_table" width="100%" cellpadding="5" cellspacing="0" border="0">
				   <?php 
$artist = $node->getAncestor("artist");
if ($artist !== false) {
    ?>
					<tr class="<?php 
    echo $row_colors[$i];
    $i = 1 - $i;
    ?>
">
						<td width="30%" valign="top">
							<nobr>
Ejemplo n.º 19
0
    if (isset($_SESSION['language'])) {
        unset($_SESSION['language']);
    }
    ?>
			<script language="javascript">
			opener.location.reload(true);
			-->
			</SCRIPT>
		<?php 
    //$this->closeWindow(true);
    //return;
}
$url_array = array();
$url_array['action'] = "popup";
$url_array['ptype'] = "preferences";
echo '<form action="' . urlize($url_array) . '" method="POST">';
?>
	<table width="100%" cellpadding="3">
<?php 
if ($cms_mode == "false") {
    ?>
		<tr>
			<td width="30%" valign="top" align="right">
				<?php 
    echo word("Password");
    ?>
:
			</td>
			<td width="70%">
				<input type="password" name="field1" class="jz_input" value="jznoupd"><br>
				<input type="password" name="field2" class="jz_input" value="jznoupd">
Ejemplo n.º 20
0
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, $enable_ratings, $truncate_artist_description, $sort_by_year, $cms_mode;
    $display =& new jzDisplay();
    $blocks =& new jzBlocks();
    $fe =& new jzFrontend();
    // 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'] = $skin; }
    $nodes = $node->getSubNodes("nodes");
    $tracks = $node->getSubNodes("tracks");
    echo '<br>';
    $blocks->blockBodyOpen();
    // Now let's setup the big table to display everything
    ?>
		<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td width="100%" valign="top" colspan="2">
					<?php 
    // Now let's include the menu system for the artist
    // First we'll need to setup some variables
    $play_all_artist = $display->link($node, false, false, false, true, true, false, true);
    $play_all_artist_rand = $display->link($node, false, false, false, true, true, true, true);
    $artist = $node->getName();
    // Now let's inlucde the artist menu
    include_once $include_path . "frontend/menus/artist-menu.php";
    ?>
				</td>
			</tr>
			<tr><td width="100%" valign="top" colspan="2" height="5"></td></tr>
			<tr>
				<td width="35%" valign="top">
					<!-- Let's show the albums -->
					<?php 
    // First let's sort this up
    if ($sort_by_year == "true") {
        sortElements($nodes, "year");
    } else {
        sortElements($nodes, "name");
    }
    foreach ($nodes as $child) {
        $display->playButton($child);
        $display->randomPlayButton($child);
        if ($enable_ratings == "true") {
            $display->rateButton($child);
        }
        echo '<input type="checkbox">';
        echo '&nbsp;';
        $year = $child->getYear();
        $dispYear = "";
        if (!isNothing($year)) {
            $dispYear = " (" . $year . ")";
        }
        $display->link($child, $display->returnShortName($child->getName(), $album_name_truncate) . $dispYear, $child->getName() . $dispYear);
        // *******************************
        // Need to know how to return NEW information HERE
        // *******************************
        echo "<br>";
    }
    include_once $include_path . 'frontend/frontends/classic/general.php';
    //displayArtistPLBar();
    echo "<br>";
    // Now let's show the art
    if (($art = $node->getMainArt('200x200')) !== false) {
        $display->image($art, $node->getName(), 200, 200, "limit", false, false, "left", "5", "5");
    }
    // Now let's show the description
    if ($cms_mode == "false") {
        echo '<span class="jz_artistDesc">';
    }
    $desc = $node->getDescription();
    echo $display->returnShortName($desc, $truncate_artist_description);
    if (strlen($desc) > $truncate_artist_description) {
        $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 '</span>';
    }
    ?>
				</td>
				<td width="65%" valign="top">
					<!-- Let's show the art -->
					<?php 
    // Ok, now let's set our table for the art
    echo '<table width="100%" cellpadding="5" cellspacing="0" border="0">';
    $c = 0;
    foreach ($nodes as $child) {
        $year = $child->getYear();
        $dispYear = "";
        if (!isNothing($year)) {
            $dispYear = " (" . $year . ")";
        }
        // Now let's see if we should start a row
        if ($c == 0) {
            echo '</tr><tr>';
        }
        // Now let's display the data
        echo '<td width="50%" align="center"><center>';
        if (($art = $child->getMainArt('200x200')) !== false) {
        } else {
            // TODO: Create the default image here IF they want it
            $art = "style/images/default.jpg";
        }
        $display->link($child, $display->returnShortName($child->getName(), $album_name_truncate) . $dispYear, $child->getName() . $dispYear, "jz_artist_album");
        echo '<br>';
        $display->link($child, $display->returnImage($art, $child->getName(), 200, false, "fit", false, false, false, false, false, "0", "jz_album_cover_picture"), $child->getName() . $dispYear);
        echo '<br><br></center></td>';
        // Now let's increment so we'll know where to make the table
        $c++;
        if ($c == 2) {
            $c = 0;
        }
    }
    echo '</table>';
    ?>
			
				</td>
			</tr>
		</table>
		<br>
		<?php 
    $blocks->trackTable($tracks, false);
    $blocks->blockBodyClose();
    echo '<br>';
}
Ejemplo n.º 21
0
    function pageTop($title)
    {
        global $img_up_arrow, $row_colors;
        $display = new jzDisplay();
        if (isset($_GET['jz_path']) || isset($_POST['jz_path'])) {
            if (isset($_POST['jz_path'])) {
                $bcArray = explode("/", $_POST['jz_path']);
                $me = new jzMediaNode($_POST['jz_path']);
            } else {
                $bcArray = explode("/", $_GET['jz_path']);
                $me = new jzMediaNode($_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 crumbs
            $path = "";
            $arr = array();
            if (isset($_GET['frame'])) {
                $arr['frame'] = $_GET['frame'];
            }
            ?>
				<table class="jz_track_table" width="100%" cellpadding="3">
					<tr class="<?php 
            echo $row_colors[1];
            ?>
">
						<td>
							<?php 
            $link = urlize($arr);
            echo $img_up_arrow . "&nbsp;";
            jzHREF($link, "", "", "", "Home");
            echo "&nbsp;";
            for ($i = 0; $i < count($bcArray); $i++) {
                echo $img_up_arrow . "&nbsp;";
                $path .= $bcArray[$i] . "/";
                $curPath = substr($path, 0, strlen($path) - 1);
                $arr = array();
                $arr['jz_path'] = $curPath;
                if (isset($_GET['frame'])) {
                    $arr['frame'] = $_GET['frame'];
                }
                $link = urlize($arr);
                jzHREF($link, "", "", "", $bcArray[$i]);
                echo "&nbsp;";
            }
            if (sizeof($bcArray) > 0) {
                echo "<br>";
            }
            ?>
						</td>
					</tr>
				<?php 
            if ($_GET['jz_path'] != "") {
                ?>
						<tr class="<?php 
                echo $row_colors[1];
                ?>
">
							<td>
								<?php 
                $display->playButton($me, false, false);
                echo "&nbsp;";
                $display->randomPlayButton($me, false, false);
                echo "&nbsp;";
                echo $title;
                ?>
							</td>
						</tr>
					<?php 
            }
            echo '</table>';
        } else {
            echo $title;
        }
    }
Ejemplo n.º 22
0
/**
 * Returns a useable URL.
 * Type is one of: image|track
 * 'arr' lets you add extra variables to our URL.
 * 
 * @author Ben Dodson
 * @version 6/9/04
 * @since 6/9/04
 */
function jzCreateLink($path, $type, $arr = array())
{
    global $media_dirs, $web_dirs, $include_path, $this_site, $root_dir, $jzUSER;
    if ($type == "image" && !($path[0] == '/' || stristr($path, ":\\") || stristr($path, ":/"))) {
        // the link is relative; return it.
        return $this_site . $root_dir . "/" . str_replace("%2F", "/", rawurlencode($path));
    }
    $media_paths = explode("|", $media_dirs);
    $web_paths = @explode("|", $web_dirs);
    if (strlen($web_dirs) > 0) {
        for ($i = 0; $i < sizeof($media_paths); $i++) {
            if (($pos = stristr($path, $media_paths[$i])) !== false) {
                if ($pos == 0 && $web_paths[$i] != "") {
                    $path = str_replace($media_paths[$i], $web_paths[$i], $path);
                    if (substr($path, 0, 4) == "http") {
                        return $path;
                    }
                    if ($type == "image" && $_SERVER['SERVER_PORT'] == 443) {
                        $link = "https://";
                    } else {
                        $link = "http://";
                    }
                    $link .= $_SERVER['HTTP_HOST'];
                    if ($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443 && strpos($link, ":") === false) {
                        $link .= ":" . $_SERVER['SERVER_PORT'];
                    }
                    $link = str_replace(":443", "", $link);
                    $ar = explode("/", $path);
                    for ($i = 0; $i < sizeof($ar); $i++) {
                        $ar[$i] = rawurlencode($ar[$i]);
                    }
                    $path = implode("/", $ar);
                    $link .= '/' . $path;
                    return $link;
                }
            }
        }
    }
    switch ($type) {
        case "image":
            $arr['action'] = "image";
            $arr['jz_path'] = $path;
            $arr['jz_user'] = $jzUSER->getId();
            return urlize($arr);
            break;
        case "track":
            if ($web_dirs != "") {
                return $path;
            } else {
                $ssid = session_id();
                writeLogData("as_debug", "jzCreateLink: ssid = " . $ssid);
                $arr['jz_path'] = $path;
                $arr['action'] = "play";
                $arr['type'] = "track";
                $arr['jza'] = $ssid;
                return urlize($arr);
            }
            break;
    }
}
Ejemplo n.º 23
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, $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>
			<table width="100%" cellpadding="5" cellspacing="0" border="0">
				<tr>
					<td>
						<table width="100%" cellpadding="3" cellspacing="0" border="0">
							<tr>
								<td align="center" class="jz_block_td">
									<?php 
        echo '<a href="' . urlize(array()) . '">';
        echo '<strong>BROWSE</strong>';
        echo '</a>';
        ?>
								</td>
								<td align="center" class="jz_block_td">
									<strong>
								    <?php 
        $urla = array();
        $urla['action'] = "powersearch";
        echo "<a href=\"" . urlize($urla) . "\">SEARCH</a>";
        ?>
										</strong>
								</td>
								<td align="center" class="jz_block_td">
									<strong>
									<?php 
        $display->randomPlayButton($node, false, word("RANDOM"));
        ?>
									</strong>
								</td>
								<td align="center" class="jz_block_td">
									<strong><?php 
        $urla['action'] = "popup";
        $urla['ptype'] = "playlistedit";
        echo "<a href=\"" . urlize($urla) . "\" onclick=\"openPopup(this, 550, 600); return false;\">PLAYLISTS</a>";
        ?>
									</strong>
								</td>
								<td align="center" class="jz_block_td">
									<strong><?php 
        $display->popupLink("preferences", "PREFERENCES");
        ?>
									</strong>
								</td>
								<td align="center" class="jz_block_td">
									<strong><?php 
        $display->loginLink("LOGIN", "LOGOUT");
        ?>
</strong>
								</td>
							</tr>
						</table>
						<br>
						<table width="100%" cellpadding="0" cellspacing="0" border="0">
							<tr>

								<?php 
        // Can this user powersearch?
        if ($jzUSER->getSetting('powersearch')) {
            ?>
								<td align="center" valign="top">
									<table width="100%" cellpadding="3" cellspacing="0" border="0">
										<tr>
											<td class="jz_block_td">
												<?php 
            $url_search = array();
            $url_search['action'] = "powersearch";
            echo '<a href="' . urlize($url_search) . '">';
            ?>
												<strong>QUICK SEARCH</strong></a>
											</td>
										</tr>
										<tr>
								<?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";
            }
            ?>
											<td class="jz_nj_block_body" align="center">
												<form action="<?php 
            echo $this_page;
            ?>
" name="searchForm" method="<?php 
            echo $method;
            ?>
" <?php 
            echo $onSubmit;
            ?>
>
												<?php 
            foreach (getURLVars($this_page) as $key => $val) {
                echo '<input type="hidden" name="' . htmlentities($key) . '" value="' . htmlentities($val) . '">';
            }
            ?>
													<input type="text" name="search_query" class="jz_input" style="width:150px; font-size:10px; margin-bottom:3px;">
													<br>
													<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="hidden" name="doSearch" value="true">
													<input type="submit" class="jz_submit" name="doSearch" value="Go">
												</form>
											</td>
										</tr>
									</table>
								</td>
								<?php 
            // This ends the if they can powersearch statement
        }
        ?>
								
								<?php 
        // Are they resampling?
        if ($display->wantResampleDropdown($node)) {
            $display->displayResampleDropdown($node);
            // PROBLEM: Currently can't use small jukebox and resampling.
        }
        if (checkPermission($jzUSER, "jukebox_queue") && ($jukebox_display == "small" or $jukebox_display == "minimal")) {
            ?>
									<td align="center">&nbsp; &nbsp;</td>
									<td align="center" valign="top">
										<table width="100%" cellpadding="3" cellspacing="0" border="0">
											<tr>
												<td class="jz_block_td" width="100%" nowrap>
													<strong>PLAYBACK</strong>
												</td>
											</tr>
											<tr>
												<td class="jz_nj_block_body" align="left" width="1%" nowrap><div id="smallJukebox">
													<?php 
            $blocks->smallJukebox(false, "top");
            ?>
												</div></td>
											</tr>
										</table>
									</td>
									<?php 
        }
        ?>
								
								
								
								<td align="center">&nbsp; &nbsp;</td>
								<td align="center" valign="top">
									<table width="100%" cellpadding="3" cellspacing="0" border="0">
										<tr>
											<td class="jz_block_td" colspan="3" width="100%" nowrap>
												<strong>CONTENT SUMMARY</strong>
											</td>
										</tr>
										<?php 
        // Let's get the stats
        if (!isset($_SESSION['jz_total_tracks'])) {
            $root = new jzMediaNode();
            $stats = $root->getStats();
            $_SESSION['jz_total_tracks'] = $stats['total_tracks'];
            $_SESSION['jz_total_genres'] = $stats['total_genres'];
            $_SESSION['jz_total_artists'] = $stats['total_artists'];
            $_SESSION['jz_total_albums'] = $stats['total_albums'];
            $_SESSION['jz_total_size'] = $stats['total_size_str'];
            $_SESSION['jz_total_length'] = $stats['total_length'];
        }
        ?>
										<tr>
											<td class="jz_nj_block_body" align="center" width="1%" nowrap>
												<?php 
        echo number_format($_SESSION['jz_total_tracks']);
        ?>
 Tracks
											</td>
											<td class="jz_nj_block_body" align="center" width="1%" nowrap>
												<?php 
        echo number_format($_SESSION['jz_total_artists']);
        ?>
 Artists
											</td>
											<td class="jz_nj_block_body" align="center" width="1%" nowrap>
												<?php 
        echo formatTime($_SESSION['jz_total_length']);
        ?>
											</td>
										</tr>
										<tr>
											<td class="jz_nj_block_body" align="center" width="1%" nowrap>
												<?php 
        echo number_format($_SESSION['jz_total_albums']);
        ?>
 Albums
											</td>
											<td class="jz_nj_block_body" align="center" width="1%" nowrap>
												<?php 
        echo number_format($_SESSION['jz_total_genres']);
        ?>
 Genres
											</td>
											<td class="jz_nj_block_body" align="center" width="1%" nowrap>
												<?php 
        echo $_SESSION['jz_total_size'];
        ?>
											</td>
										</tr>
									</table>
								</td>
								<td align="center">&nbsp; &nbsp;</td>
								<td align="center" valign="top">
									<table width="100%" cellpadding="3" cellspacing="0" border="0">
										<tr>
											<td class="jz_block_td">
												<strong>ARTISTS A-Z <?php 
        echo "(" . $_SESSION['jz_num_artists'] . ")";
        ?>
</strong> - 
												<?php 
        $urlar = array();
        //$urlar['jz_path'] = $node->getPath("String");
        $urlar['jz_level'] = distanceTo("artist");
        $urlar['jz_letter'] = "*";
        echo "<a href=\"" . urlize($urlar) . "\">" . word("All") . "</a>";
        ?>
											</td>
										</tr>
										<tr>
											<td class="jz_nj_block_body" align="center">
												<?php 
        for ($let = 'A'; $let != 'Z'; $let++) {
            $urlar['jz_letter'] = $let;
            echo "<a href=\"" . urlize($urlar) . "\">" . $let . "</a> ";
            if ($let == 'L' or $let == 'X') {
                echo "<br>";
            }
        }
        $urlar['jz_letter'] = "Z";
        echo "<a href=\"" . urlize($urlar) . "\">Z</a> ";
        for ($let = '1'; $let != '10'; $let++) {
            $urlar['jz_letter'] = $let;
            echo "<a href=\"" . urlize($urlar) . "\">" . $let . "</a> ";
        }
        $urlar['jz_letter'] = "*";
        echo "<a href=\"" . urlize($urlar) . "\">0</a>&nbsp;";
        ?>
											</td>
										</tr>
									</table>
								</td>
								<td align="center">&nbsp; &nbsp;</td>
								<td align="center" valign="top">
									<table width="100%" cellpadding="3" cellspacing="0" border="0">
										<tr>
											<td class="jz_block_td">
												<strong>ALBUMS A-Z <?php 
        echo "(" . $_SESSION['jz_num_albums'] . ")";
        ?>
</strong> - 
												<?php 
        $urlar['jz_level'] = distanceTo("album");
        $urla['jz_letter'] = "*";
        echo "<a href=\"" . urlize($urlar) . "\">" . word("All") . "</a>";
        ?>
											</td>
										</tr>
										<tr>
											<td class="jz_nj_block_body" align="center">
												<?php 
        for ($let = 'A'; $let != 'Z'; $let++) {
            $urlar['jz_letter'] = $let;
            echo "<a href=\"" . urlize($urlar) . "\">" . $let . "</a> ";
            if ($let == 'L' or $let == 'X') {
                echo "<br>";
            }
        }
        $urlar['jz_letter'] = "Z";
        echo "<a href=\"" . urlize($urlar) . "\">Z</a> ";
        for ($let = '1'; $let != '10'; $let++) {
            $urlar['jz_letter'] = $let;
            echo "<a href=\"" . urlize($urlar) . "\">" . $let . "</a> ";
        }
        $urlar['jz_letter'] = "0";
        echo "<a href=\"" . urlize($urlar) . "\">0</a>&nbsp;";
        ?>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
						
						<?php 
        // Are they in Jukebox mode?
        if (checkPermission($jzUSER, "jukebox_queue") && $jukebox_display != "small" && $jukebox_display != "off") {
            ?>
							<br>
							<table width="100%" cellpadding="3" cellspacing="0" border="0">
								<tr>
									<td align="center" class="jz_block_td">
										<div id="jukebox">
							    <?php 
            include jzBlock('jukebox');
            ?>
							                        </div>
									</td>
								</tr>
							</table>
							<?php 
        }
        ?>
					</td>
				</tr>
			</table>
			
			<?php 
    }
Ejemplo n.º 24
0
    function trackTable($tracks, $purpose = false)
    {
        global $media_dir, $jinzora_skin, $hierarchy, $album_name_truncate, $row_colors, $img_more, $img_email, $img_rate, $img_discuss, $num_other_albums, $enable_ratings, $this_site, $allow_clips, $root_dir, $jzUSER, $hide_id3_comments, $max_song_length, $enable_discussion, $max_song_name_length, $show_lyrics_links, $allow_send_email, $handle_compilations, $video_types, $show_track_numbers;
        if (sizeof($tracks) == 0) {
            return;
        }
        // Let's setup the new display object
        $display =& new jzDisplay();
        $tracks_only = array();
        foreach ($tracks as $track) {
            if (is_object($track)) {
                $tracks_only[] = $track;
            }
        }
        // Now let's see if this is a Audio, Video, or Photo node
        $video = true;
        foreach ($tracks_only as $track) {
            if (!preg_match("/\\.({$video_types})\$/i", $track->getDataPath())) {
                $video = false;
            }
        }
        if ($video) {
            $this->videoTable($tracks_only, $purpose);
            return;
        }
        // Let's figure out our settings:
        // First, set the defaults.
        $showNumbers = false;
        if ($show_track_numbers == "true") {
            $showNumbers = true;
        }
        $showArtist = false;
        $showAlbum = false;
        $showCheck = false;
        $showInfo = false;
        $showEmail = false;
        $showRate = false;
        $showDisc = false;
        $showAlbumNames = false;
        $trackTruncate = false;
        $showPlayCount = false;
        if ($enable_discussion == "true") {
            $showDisc = true;
        }
        $trackTruncate = $max_song_name_length;
        // Now adjust as needed:
        switch ($purpose) {
            case "generic":
                $showNumbers = false;
                break;
            case "album":
                $showCheck = true;
                $showInfo = true;
                $showPlayCount = true;
                $showEmail = true;
                break;
            case "search":
                $showCheck = true;
                $showArtist = true;
                $showInfo = true;
                $showEmail = true;
                $trackTruncate = 100;
                break;
            case "sample":
                // We only want to show album thumbs IF this artist has more than 1 album
                $parent = $tracks_only[0]->getParent();
                $gParent = $parent->getParent();
                $nodes = $gParent->getSubNodes("nodes");
                $showNumbers = false;
                $showAlbum = true;
                break;
            case "sample-all":
                $showNumbers = false;
                $showCheck = true;
                $showAlbumNames = true;
                $trackTruncate = 20;
                break;
        }
        if ($allow_send_email == "false") {
            $showEmail = false;
        }
        // Do we need to start the form
        if ($showCheck) {
            $node = $tracks_only[0]->getParent();
            ?>
			<form name="albumForm" action="<?php 
            echo urlize();
            ?>
" method="POST">
			<input type="hidden" name="<?php 
            echo jz_encode("action");
            ?>
" value="<?php 
            echo jz_encode("mediaAction");
            ?>
">
				<?php 
            if ($purpose != "search") {
                ?>
 
			  <input type="hidden" name="<?php 
                echo jz_encode("jz_path");
                ?>
" value="<?php 
                echo htmlentities(jz_encode($node->getPath("String")));
                ?>
">
				<?php 
            }
            ?>
			<input type="hidden" name="<?php 
            echo jz_encode("jz_list_type");
            ?>
" value="<?php 
            echo jz_encode("tracks");
            ?>
">
			<?php 
        }
        // Now let's setup the big table to display everything
        $i = 0;
        ?>
		  <table class="jz_track_table" width="100%" cellpadding="3" cellspacing="0" border="0">
		 <?php 
        $artists = array();
        if ($handle_compilations == "true") {
            foreach ($tracks_only as $child) {
                $a = $child->getMeta();
                if (!isNothing($a['artist'])) {
                    $artists[$a['artist']] = true;
                }
            }
        } else {
            foreach ($tracks_only as $child) {
                $a = $child->getAncestor('artist');
                if ($a !== false) {
                    $artists[strtoupper($a->getName())] = true;
                }
            }
        }
        if (sizeof($artists) > 1) {
            $multiArtist = true;
        } else {
            $multiArtist = false;
        }
        $first_label = true;
        foreach ($tracks as $child) {
            // is it a header?
            if (is_string($child)) {
                if (!$first_label) {
                    echo '<tr><td colspan="100">&nbsp;</td></tr>';
                }
                echo '<tr><td colspan="100">' . $child . '</td></tr>';
                $first_label = false;
                continue;
            }
            // Let's make sure this isn't a lofi track
            if (substr($child->getPath("String"), -9) == ".lofi.mp3" or substr($child->getPath("String"), -9) == ".clip.mp3") {
                continue;
            }
            // First let's grab all the tracks meta data
            $metaData = $child->getMeta();
            $album = $child->getParent();
            if (findPType($album) == "disk") {
                $album = $album->getParent();
            }
            $gParent = $album->getParent();
            $artist = getInformation($album, "artist");
            ?>
		   <tr class="<?php 
            echo $row_colors[$i];
            ?>
">
		   <?php 
            if ($showCheck and $jzUSER->getSetting('stream')) {
                $value = htmlentities(jz_encode($child->getPath("String")));
                ?>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <input type="checkbox" name="jz_list[]" value="<?php 
                echo $value;
                ?>
">
		   </td>
		   <?php 
            }
            ?>
		   
		   <td width="99%" valign="top" class="jz_track_table_songs_td" nowrap>
		   	<?php 
            echo $display->playButton($child);
            ?>
			 <?php 
            // Now, is there a lofi version?
            $loFile = substr($child->getDataPath("String"), 0, -4) . ".lofi.mp3";
            if (is_file($loFile) and $jzUSER->getSetting('stream')) {
                $lofi = new jzMediaTrack(substr($child->getPath("String"), 0, -4) . ".lofi.mp3");
                //echo '<td width="1%" valign="top" class="jz_track_table_songs_td">';
                echo $display->lofiPlayButton($lofi);
                //echo '</td>';
            }
            ?>
			   <?php 
            // Now, is there a clip version?
            $loFile = substr($child->getDataPath("String"), 0, -4) . ".clip.mp3";
            if (is_file($loFile) || $allow_clips == "true") {
                //echo '<td width="1%" valign="top" class="jz_track_table_songs_td">';
                echo $display->clipPlayButton($child);
                //echo '</td>';
            }
            ?>
			   
		   <?php 
            echo $display->downloadButton($child);
            ?>
		   <?php 
            // Do they want ratings?
            if ($enable_ratings == "true") {
                $display->rateButton($child);
            }
            if ($showInfo) {
                echo " ";
                $display->infoButton($child);
            }
            if ($showEmail and $jzUSER->getSetting('stream')) {
                $display->emailButton($child);
            }
            ?>
		   <?php 
            if ($showDisc) {
                ?>
		   <a class="jz_track_table_songs_href" href=""><?php 
                $display->displayDiscussIcon($child);
                ?>
</a>
		   <?php 
            }
            ?>
		   <?php 
            if ($showArtist !== false) {
                $j = 0;
                while ($j < sizeof($hierarchy) && $hierarchy[$j] != 'artist') {
                    $j++;
                }
                if ($j < sizeof($hierarchy)) {
                    $parent = $child;
                    while ($parent->getLevel() > $j + 1) {
                        $parent = $parent->getParent();
                    }
                    $display->link($parent, $parent->getName(), $parent->getName(), "jz_track_table_songs_href");
                    echo " / ";
                }
            }
            // This is where we display the name
            if ($multiArtist) {
                if ($handle_compilations == "true") {
                    $artistName = $metaData['artist'];
                    if (isNothing($artistName)) {
                        $artist = $child->getAncestor("artist");
                        if ($artist !== false) {
                            $artistName = $artist->getName();
                        }
                    }
                } else {
                    $artist = $child->getAncestor("artist");
                    if ($artist !== false) {
                        $artistName = $artist->getName();
                    }
                }
                if (isset($artistName)) {
                    $tName = $child->getName();
                    unset($artistName);
                } else {
                    $tName = $child->getName();
                }
            } else {
                $tName = $child->getName();
            }
            if ($trackTruncate) {
                $tName = returnItemShortName($tName, $trackTruncate);
            }
            if ($purpose == "search") {
                $album = $child->getAncestor("album");
                $display->link($album, $album->getName(), $album->getName(), "jz_track_table_songs_href");
                echo " / ";
            }
            if ($showNumbers) {
                echo $metaData['number'] . " -&nbsp;";
            }
            if ($jzUSER->getSetting('stream')) {
                if ($showAlbum) {
                    $descName = $album->getName() . " - " . $child->getName();
                } else {
                    $descName = $child->getName();
                }
                // $tName = $child->getName();
                $display->link($child, $tName, $descName, "jz_track_table_songs_href");
            } else {
                echo $tName;
            }
            // Did they want to see lyrics links?
            if ($show_lyrics_links == "true") {
                if ($metaData['lyrics'] != "") {
                    $urlArr = array();
                    $urlArr['jz_path'] = $child->getPath("String");
                    $urlArr['action'] = "popup";
                    $urlArr['ptype'] = "viewlyricsfortrack";
                    echo '<a href="' . urlize($urlArr) . '" onclick="openPopup(this, 450, 450); return false;"> - ' . word("Lyrics") . '</a>';
                }
            }
            // Now let's show the description if there is one
            if ($short_desc = $child->getShortDescription() and $hide_id3_comments == "false") {
                echo "<br>" . $short_desc;
            }
            if ($description = $child->getDescription()) {
                echo "<br>" . $description;
            }
            // Do they want ratings?
            /*if ($enable_ratings == "true"){
               		//$rating = $display->displayRating($child,true);
            		if ($rating){
            			//echo "<br>". $rating;
            		}
            		//unset($rating);
               }*/
            ?>
		   </td>
		   
		   <?php 
            $lyricsSearch = false;
            if (isset($_POST['search_type'])) {
                if ($_POST['search_type'] == "lyrics") {
                    $lyricsSearch = $_POST['search_query'];
                }
            }
            if (isset($_GET['search_type'])) {
                if ($_GET['search_type'] == "lyrics") {
                    $lyricsSearch = $_GET['search_query'];
                }
            }
            if ($lyricsSearch) {
                // Now let's get the lyrics back
                $lyrics = $child->getLyrics();
                // Now let's parse it out
                $lyrics = str_replace("Lyrics Provided by: Leo's Lyrics\nhttp://www.leoslyrics.com", "", $lyrics);
                $start = strpos(strtolower($lyrics), strtolower($lyricsSearch)) - 20;
                if ($start < 0) {
                    $start = 0;
                }
                $lyrics = "&nbsp; &nbsp; &nbsp; &nbsp;(..." . substr($lyrics, $start, strlen($lyricsSearch) + 40) . "...)";
                $lyrics = highlight($lyrics, $lyricsSearch);
                echo '<td width="6%" align="center" valign="top" class="jz_track_table_songs_td" nowrap>';
                echo $lyrics;
                echo '</td>';
            }
            ?>
		   
		   
		   <?php 
            if ($showAlbumNames) {
                echo '<td width="1%" class="jz_track_table_songs_td" nowrap>';
                $display->link($album, returnItemShortName($album->getName(), 20), $album->getName(), "jz_track_table_songs_href");
                echo '</td>';
            }
            ?>
		   
			<?php 
            if ($showPlayCount) {
                echo '<td width="1%" align="center" valign="top" class="jz_track_table_songs_td" nowrap>';
                if ($child->getPlayCount() != 0) {
                    echo $child->getPlayCount() . " " . word("Plays");
                } else {
                    echo " - ";
                }
                echo '</td>';
            }
            ?>
		   
		   
		   <td width="6%" align="center" valign="top" class="jz_track_table_songs_td" nowrap>
		   &nbsp; <?php 
            echo convertSecMins($metaData['length']);
            ?>
 &nbsp;
		   </td>
		   </tr>
		   <?php 
            $i = 1 - $i;
            unset($gParent);
            unset($album);
        }
        // Now let's set a field with the number of checkboxes that were here
        echo "</table>";
        // Now let's show the playlist bar if we should
        if ($showCheck) {
            $this->blockSpacer();
            $this->playlistBar();
            echo "</form>";
        }
    }
Ejemplo n.º 25
0
        echo '</form>';
        ?>
				<SCRIPT language="JavaScript">
				document.retagger.submit();
				</SCRIPT>

				<?php 
        exit;
    }
}
// Now let's give them a form so they can pick what to auto-tag
$arr = array();
$arr['action'] = "popup";
$arr['ptype'] = "retagger";
$arr['jz_path'] = $node->getPath("String");
echo '<form name="retagger" action="' . urlize($arr) . '" method="POST">';
?>
		<?php 
echo word("This tool will rewrite the ID3 tags on your MP3 files based on their structure in the filesystem or with the values you specify below.  You may select which values will be updated by check them below.");
?>
		<br><br>
		<table width="100%">
			<tr>
				<td valign="top">
					<input type="checkbox" <?php 
if (getInformation($node, "genre") !== false) {
    echo "checked";
}
?>
 name="reGenre"> <?php 
echo word("Genre");
Ejemplo n.º 26
0
    /**
     * 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;
        while ($c < $random_albums + 1) {
            $dataArray = array_slice($fullArray, $start, $random_per_slot);
            for ($ctr = 0; $ctr < count($dataArray); $ctr++) {
                echo "imgItem" . $c . "[" . $ctr . "]=\"" . $dataArray[$ctr] . '"' . "\n";
            }
            // Now let's move on
            $start = $start + $random_per_slot;
            $c++;
        }
        // Now let's create the functions
        $c = 1;
        while ($c < $random_albums + 1) {
            ?>
					
						var current<?php 
            echo $c;
            ?>
=0
						<?php 
            $c++;
        }
        $c = 1;
        while ($c < $random_albums + 1) {
            ?>
						var ns6=document.getElementById&&!document.all
						function changeItem<?php 
            echo $c;
            ?>
(){
							if(document.layers){
								document.layer1.document.write(imgItem<?php 
            echo $c;
            ?>
[current<?php 
            echo $c;
            ?>
])
								document.layer1.document.close()
							}
							if(ns6)document.getElementById("div<?php 
            echo $c;
            ?>
").innerHTML=imgItem<?php 
            echo $c;
            ?>
[current<?php 
            echo $c;
            ?>
]
							{
								if(document.all){
									div<?php 
            echo $c;
            ?>
.innerHTML=imgItem<?php 
            echo $c;
            ?>
[current<?php 
            echo $c;
            ?>
]
								}
							}
							if (current<?php 
            echo $c;
            ?>
==<?php 
            echo $random_per_slot - 1;
            ?>
) current<?php 
            echo $c;
            ?>
=0
							else current<?php 
            echo $c;
            ?>
++
							<?php 
            if ($random_per_slot != 1) {
                ?>
									setTimeout("changeItem<?php 
                echo $c;
                ?>
()",<?php 
                echo $random_rate;
                ?>
)
									<?php 
            }
            ?>
						}
						<?php 
            $c++;
        }
        $c = 1;
        while ($c < $random_albums + 1) {
            ?>
					
						changeItem<?php 
            echo $c;
            ?>
();
						<?php 
            $c++;
        }
        ?>
				
				//-->
			</script>
			<?php 
    }
Ejemplo n.º 27
0
}
// Now should we show this bar?
$bcArray = explode("/", $jzPath);
$url = array();
$smarty->assign('home_link', urlize($url));
$smarty->assign('word_home', word("Home"));
$smarty->assign('open_folder', $include_path . 'style/images/folder.gif');
// open-folder is ugly
// Now let's see if we need the breadcrumbs
unset($bcArray[count($bcArray) - 1]);
$path = "";
$crumbs = "";
foreach ($bcArray as $item) {
    if ($item != "") {
        $path .= "/" . $item;
        $arr['jz_path'] = $path;
        $crumbs .= ' / <a href="' . urlize($arr) . '">' . $item . '</a>';
    }
    unset($arr);
}
$smarty->assign('bread_crumbs', $crumbs);
$smarty->assign('artist_list', "");
if ($show_artist_list == "true") {
    $artist_list = word("Artists") . ": ";
    $artist_list .= '<form action="' . $this_page . '" method="post">';
    $artist_list .= $display->hiddenPageVars(true);
    $artist_list .= $display->dropdown("artist", true, "jz_path", false, true);
    $artist_list .= '</form>';
    $smarty->assign('artist_list', $artist_list);
}
jzTemplate($smarty, "browse-bar");
Ejemplo n.º 28
0
<?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');
Ejemplo n.º 29
0
 function urlSeoGen($lang)
 {
     $Url = D()->page_url->Entry(array('page_id' => $this, 'lang' => $lang))->makeIfNot();
     if ($Url->custom) {
         return $Url->url;
     }
     if ($this->vs['type'] === 'c') {
         $url = '#cmspid' . $this;
     } else {
         $base = !$this->Parent() || $this->Parent()->id == 1 ? $lang : $this->Parent()->urlSeo($lang);
         $part = urlize($this->title()->getTranslated($lang));
         $url = $base === '' || substr($base, -1) === '/' ? $base . $part : $base . '/' . $part;
     }
     if (file_exists(appPATH . $url) || D()->one("SELECT page_id FROM page_url WHERE url = " . D()->quote($url) . " AND !(page_id = " . $this . " AND lang = '" . $lang . "') ")) {
         $url .= '-' . $lang . $this;
     }
     $Url->url = $this->urls[$lang] = $url;
     $Url->__destruct();
     foreach ($this->Childs(array('type' => '*')) as $C) {
         $C->urlSeoGen($lang);
     }
     return $url;
 }
Ejemplo n.º 30
-1
 function jzPopup()
 {
     global $jzUSER;
     // Now let's se if they selected a Genre, Artist, or Album:
     if (isset($_POST['chosenPath'])) {
         if (isset($_POST['jz_type']) && $_POST['jz_type'] == "track") {
             if (checkPermission($jzUSER, 'play', $_POST['chosenPath']) === false) {
                 $this->closeWindow(false);
             }
             $e = new jzMediaTrack($_POST['chosenPath']);
             $pl = new jzPlaylist();
             $pl->add($e);
             $pl->play();
             exit;
         } else {
             $return = $this->returnGoBackPage($_POST['return']);
         }
         //$url = $return. "&" . jz_encode("path") . "=". jz_encode(urlencode($_POST['chosenPath']));
         $link = array();
         $link['jz_path'] = $_POST['chosenPath'];
         // Now let's fix that if we need to
         // Ok, now that we've got the URL let's refresh the parent and close this window
         echo '<body onload="opener.location.href=\'' . urlize($link) . '\';window.close();">';
         exit;
     }
 }