Example #1
0
$smarty->assign('form_action_val', jz_encode("mediaAction"));
$smarty->assign('form_path', jz_encode("jz_path"));
$smarty->assign('form_path_val', htmlentities(jz_encode($node->getPath("String"))));
$smarty->assign('form_list_type', jz_encode("jz_list_type"));
$smarty->assign('form_list_type_val', jz_encode("tracks"));
$smarty->assign('purpose', $purpose);
$i = 0;
$c = 0;
// Now let's loop through the track nodes
foreach ($tracks as $track) {
    // Let's get the meta data
    // This will return the meta data (like length, size, bitrate) into a keyed array
    $meta = $track->getMeta();
    $c = 1 - $c;
    $array[$i]['row_color'] = $row_colors[$c];
    $array[$i]['path'] = jz_encode($track->getPath("String"));
    $array[$i]['download_button'] = $display->downloadButton($track, true, true);
    $array[$i]['play_button'] = $display->playLink($track, $img_play, false, false, true);
    $array[$i]['track_num'] = "";
    // Did they want track numbers?
    if ($show_track_num == "true") {
        // Now let's link to this track
        $number = $meta['number'];
        if ($number != "") {
            if (strlen($number) < 2) {
                $array[$i]['track_num'] = "&nbsp;";
            }
            $array[$i]['track_num'] .= $number . ". ";
        }
    }
    $array[$i]['track_name'] = $display->playLink($track, $meta['title'], false, false, true);
Example #2
0
 /**
  * Displays the block for the album on the Artist page
  *
  * @author Ben Dodson, Ross Carlson
  * @since 9/13/05
  * @version 9/13/05
  *
  **/
 function artistAlbumsBlock($node = false)
 {
     global $jzUSER, $album_name_truncate, $img_play, $img_random_play, $img_play_dis, $img_random_play_dis, $sort_by_year, $web_root, $root_dir, $this_page, $show_album_clip_play, $img_clip;
     $display = new jzDisplay();
     // Are they sorting?
     if (isset($_GET['sort'])) {
         $_SESSION['jz_purge_file_cache'] = "true";
         $jzUSER->setSetting("sort", $_GET['sort']);
     }
     $mysort = $jzUSER->getSetting("sort");
     // Does the cache file exist?
     if ($display->startCache("artistAlbumsBlock", $node, $mysort)) {
         return;
     }
     if (!defined('NO_AJAX_LINKS') && $node === false) {
         $node = new jzMediaNode($_SESSION['jz_path']);
     }
     // Let's create our buttons for later
     // Now let's create the sort link
     if ($node->getSubNodeCount() > 1) {
         $url_array = array();
         $url_array['jz_path'] = $node->getPath("String");
         $url_array['sort'] = "alpha";
         $url_name = urlize($url_array);
         $url_array['sort'] = "year";
         $url_year = urlize($url_array);
         $form = '<form action="' . $this_page . '" method="GET">' . "\n";
         $form .= '<input type="hidden" name="' . jz_encode("jz_path") . '" value="' . jz_encode($node->getPath("String")) . '">';
         $form .= $display->hiddenPageVars(true);
         $form .= '<select style="width:52px; height:15px; font-size:9px;" name="' . jz_encode("sort") . '" class="jz_select" onChange="form.submit();">' . "\n";
         $form .= '<option ';
         if ($mysort == "year") {
             $form .= " selected ";
         }
         $form .= ' value="' . jz_encode("year") . '">Year</option>';
         $form .= '<option ';
         if ($mysort == "alpha") {
             $form .= " selected ";
         }
         $form .= 'value="' . jz_encode("alpha") . '">Name</option>';
         $form .= '</select></form>';
         $playButtons .= $form . " ";
     }
     if ($jzUSER->getSetting('stream')) {
         $playButtons .= $display->playLink($node, $img_play, false, false, true) . " " . $display->playLink($node, $img_random_play, false, false, true, true) . "&nbsp;";
     } else {
         $playButtons .= $img_play_dis . $img_random_play_dis . "&nbsp;";
     }
     // Let's startup Smarty
     $smarty = smartySetup();
     // Now let's assign our variables to smarty
     $smarty->assign('title', word("Albums") . ": " . $node->getName() . " (" . $node->getSubNodeCount() . ")");
     $smarty->assign('playButtons', $playButtons);
     $smarty->assign('formaction', urlize());
     $smarty->assign('formhandler', $display->embeddedFormHandler());
     $smarty->assign('action', jz_encode("action"));
     $smarty->assign('action_value', jz_encode("mediaAction"));
     $smarty->assign('jz_path', jz_encode("jz_path"));
     $smarty->assign('jz_path_value', htmlentities(jz_encode($node->getPath("String"))));
     $smarty->assign('jz_list_type', jz_encode("jz_list_type"));
     $smarty->assign('jz_list_type_value', jz_encode("nodes"));
     // Now let's display the template
     $smarty->display(SMARTY_ROOT . 'templates/slick/artist-albums-block.tpl');
     // Now lets finish out the cache
     $display->endCache();
 }
Example #3
0
    $be->storeData($news, nl2br(str_replace("<br />", "", $_POST['siteNewsData'])));
}
// Let's show the form to edit with
$arr = array();
$arr['action'] = "popup";
$arr['ptype'] = "sitenews";
$arr['jz_path'] = $_GET['jz_path'];
echo '<form action="' . urlize($arr) . '" method="POST">';
?>
		<br>
		<center>
			<textarea name="siteNewsData" cols="60" rows="20" class="jz_input"><?php 
echo $be->loadData($news);
?>
</textarea>
			<br><br>
			<input type="submit" value="<?php 
echo word("Update News");
?>
" name="<?php 
echo jz_encode("updateSiteNews");
?>
" class="jz_submit">
			&nbsp;
			<?php 
$this->closeButton(false);
?>
		</center>
		<?php 
$this->closeBlock();
exit;
Example #4
0
/** 
 * Returns the AJAX code for the Whow is where block
 *
 * @author Ross Carlson
 * @since 8.21.05
 *
 **/
function returnBreadcrumbs()
{
    global $img_up_arrow, $this_page;
    // Now let's create the breadcrumbs
    $bcArray = explode("/", $_SESSION['jz_path']);
    $node = new jzMediaNode($_SESSION['jz_path']);
    $display = new jzDisplay();
    $bcrumbs = "";
    $bcrumbs = $img_up_arrow . " ";
    $bcrumbs .= '<a href="' . str_replace("ajax_request.php", "index.php", $this_page) . '">' . word("Home") . '</a>';
    $bcrumbs .= "&nbsp;";
    // 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 = "";
    for ($i = 0; $i < count($bcArray); $i++) {
        $bcrumbs .= $img_up_arrow . "&nbsp;";
        $path .= $bcArray[$i] . "/";
        $curPath = substr($path, 0, strlen($path) - 1);
        $arr = array();
        $arr['jz_path'] = $curPath;
        $link = str_replace("ajax_request.php", "index.php", urlize($arr));
        $bcrumbs .= '<a href="' . $link . '">' . $bcArray[$i] . '</a>';
        $bcrumbs .= "&nbsp;";
    }
    $mode = "GET";
    $bcrumbs .= '<form action="' . $this_page . '" method="' . $mode . '">';
    $bcrumbs .= '- <select style="width:100px" class="jz_select" name="' . jz_encode('jz_path') . '" onChange="form.submit();">';
    $parent = $node->getParent();
    $nodes = $parent->getSubNodes("nodes");
    foreach ($nodes as $child) {
        $path = $child->getPath("String");
        $bcrumbs .= '<option ';
        // Is this the current one?
        if ($child->getName() == $node->getName()) {
            $bcrumbs .= ' selected ';
        }
        $bcrumbs .= 'value="' . jz_encode($path) . '">' . $display->returnShortName($child->getName(), 20) . '</option>';
    }
    $bcrumbs .= '</select>';
    $bcrumbs .= "</form>&nbsp;";
    echo $bcrumbs;
    exit;
}
Example #5
0
    $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");
}
$smarty->assign('form_action', urlize());
$smarty->assign('hidden_field', '<input type="hidden" name="' . jz_encode('jz_list_type') . '" value="' . jz_encode('nodes') . '">');
// Now let's loop through the nodes
$i = 0;
$c = 0;
foreach ($nodes as $item) {
    $array[$i]['name'] = $item->getName();
    $array[$i]['path'] = $item->getPath('string');
    $array[$i]['link'] = $display->link($item, $img_folder, false, false, true);
    $name = $item->getName();
    if (!isNothing($item->getYear()) and $item->getPType() == "album") {
        $name .= " (" . $item->getYear() . ")";
    }
    $array[$i]['name'] = $display->link($item, $name, false, false, true);
    if (($count = $item->getSubNodeCount("nodes")) != 0) {
        if ($count > 1) {
            $folder = word("folders");
Example #6
0
					var winOpt = "width=" + boxWidth + ",height=" + boxHeight + ",left=" + ((sw - boxWidth) / 2) + ",top=" + ((sh - boxHeight) / 2) + ",menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,resizable=no";
					thisWin = window.open(obj,'StatusPop',winOpt);
				}	
			-->
			</SCRIPT>
			<?php 
$aRR = array();
$aRR['action'] = "popup";
$aRR['ptype'] = "showuploadstatus";
?>
			<input onMouseDown="openStatusPop('<?php 
echo urlize($aRR);
?>
',300,200)" type=submit class="jz_submit" name="<?php 
echo jz_encode('uploadfiles');
?>
" value="<?php 
echo word('Upload');
?>
">
			<!--<input type=submit class="jz_submit" name="<?php 
echo jz_encode('add_link_track');
?>
" value="<?php 
echo word('Add Link Track');
?>
">-->
		</center>
		<?php 
echo '</form>';
$this->closeBlock();
Example #7
0
function setThisPage()
{
    global $link_root, $cms_type, $cms_mode, $fe;
    if (defined('JZ_URL_OVERRIDE')) {
        $link = JZ_URL_OVERRIDE . '?';
    } else {
        if ($cms_mode === false || $cms_mode == "false" || $link_root == "") {
            //$a = explode("/",$_SERVER['PHP_SELF']);
            //$link = $a[sizeof($a)-1] . '?';
            $link = $_SERVER['PHP_SELF'];
            $link = substr($link, 0, strrpos($link, '/')) . '/index.php?';
            $link = str_replace("popup.php", "index.php", $link);
        } else {
            //
            $link = $link_root;
        }
    }
    // check for things that need to be added:
    $this_page = $link;
    // Add additional settings to our URL:
    if (isset($_GET['set_frontend'])) {
        $this_page .= urlencode(jz_encode("frontend")) . "=" . urlencode(jz_encode($_GET['set_frontend'])) . "&";
        $_GET['frontend'] = $_GET['set_frontend'];
    } else {
        if (isset($_POST['set_frontend'])) {
            $this_page .= urlencode(jz_encode("frontend")) . "=" . urlencode(jz_encode($_POST['set_frontend'])) . "&";
            $_GET['frontend'] = $_POST['set_frontend'];
        } else {
            if (isset($_GET['view'])) {
                $this_page .= urlencode(jz_encode("frontend")) . "=" . urlencode(jz_encode($_GET['view'])) . "&";
                $_GET['frontend'] = $_GET['view'];
            } else {
                if (isset($_GET['frontend'])) {
                    $this_page .= urlencode(jz_encode("frontend")) . "=" . urlencode(jz_encode($_GET['frontend'])) . "&";
                }
            }
        }
    }
    if (isset($_GET['set_theme'])) {
        $this_page .= urlencode(jz_encode("theme")) . "=" . urlencode(jz_encode($_GET['set_theme'])) . "&";
        $_GET['theme'] = $_GET['set_theme'];
    } else {
        if (isset($_POST['set_theme'])) {
            $this_page .= urlencode(jz_encode("theme")) . "=" . urlencode(jz_encode($_POST['set_theme'])) . "&";
            $_GET['theme'] = $_POST['set_theme'];
        } else {
            if (isset($_GET['style'])) {
                $this_page .= urlencode(jz_encode("theme")) . "=" . urlencode(jz_encode($_GET['style'])) . "&";
                $_GET['theme'] = $_GET['style'];
            } else {
                if (isset($_GET['theme'])) {
                    $this_page .= urlencode(jz_encode("theme")) . "=" . urlencode(jz_encode($_GET['theme'])) . "&";
                }
            }
        }
    }
    if (isset($_GET['set_language'])) {
        $this_page .= urlencode(jz_encode("language")) . "=" . urlencode(jz_encode($_GET['set_language'])) . "&";
        $_GET['language'] = $_GET['set_language'];
    } else {
        if (isset($_POST['set_language'])) {
            $this_page .= urlencode(jz_encode("language")) . "=" . urlencode(jz_encode($_POST['set_language'])) . "&";
            $_GET['language'] = $_POST['set_language'];
        } else {
            if (isset($_GET['language'])) {
                $this_page .= urlencode(jz_encode("language")) . "=" . urlencode(jz_encode($_GET['language'])) . "&";
            }
        }
    }
    return $this_page;
}
Example #8
0
function drawPage(&$node)
{
    global $media_dir, $jinzora_skin, $hierarchy, $album_name_truncate, $row_colors, $img_download, $img_more, $img_email, $img_play, $img_random_play, $img_rate, $img_discuss, $num_other_albums, $root_dir, $enable_ratings, $short_date, $jzUSER, $img_play_dis, $img_random_play_dis, $img_download_dis, $show_similar, $show_radio, $jzSERVICES, $show_album_art, $this_page, $num_track_cols;
    // Let's setup the new display object
    $display =& new jzDisplay();
    $blocks =& new jzBlocks();
    $fe =& new jzFrontend();
    $parent = $node->getAncestor("artist");
    handleFrontendOverrides();
    ?>
	

		  <table width="100%" cellpadding="5" cellspacing="0" border="0">
		     <tr>
		     <td>
		     <table width="100%" cellpadding="3" cellspacing="0" border="0">
		     <?php 
    $colwidth = floor(100 / $num_track_cols);
    $tracks = $node->getSubNodes('tracks', -1);
    $c = 1;
    $c2 = 0;
    echo '<tr><td class="jz_nj_block_body" colspan="2">';
    $artist = $tracks[0]->getAncestor("artist");
    if ($artist) {
        $display->playButton($artist);
        echo " ";
        $display->link($artist, $artist->getName());
    } else {
        echo $meta['artist'];
    }
    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    $display->playButton($node);
    echo " ";
    $display->link($node, $node->getName());
    ?>
		  </td></tr>
		  <tr>
		     <td class="jz_block_td" colspan="<?php 
    echo $num_track_cols;
    ?>
" nowrap>
		     <strong>Track Names</strong>
		     </td>
		     </tr>
		     
		     <form name="tracklist" method="POST" action="<?php 
    echo urlize(array());
    ?>
">
		     <input type="hidden" name="<?php 
    echo jz_encode("action");
    ?>
" value="<?php 
    echo jz_encode("mediaAction");
    ?>
">
		     <input type="hidden" name="<?php 
    echo jz_encode("jz_path");
    ?>
" value="<?php 
    echo htmlentities(jz_encode($node->getPath("String")));
    ?>
">
		     <input type="hidden" name="<?php 
    echo jz_encode("jz_list_type");
    ?>
" value="<?php 
    echo jz_encode("tracks");
    ?>
">
		     <input type="hidden" name="<?php 
    echo jz_encode("sendList");
    ?>
" value="<?php 
    echo jz_encode("true");
    ?>
">
		     <input type="hidden" name="randomize" value="false">
		     <?php 
    foreach ($tracks as $track) {
        $meta = $track->getMeta();
        $c = 2;
        if ($c2 % $num_track_cols == 0) {
            if ($c2 > 0) {
                echo '</tr>';
            }
            echo '<tr>';
        }
        echo '<td class="jz_nj_block_body" width="' . $colwidth . '%">';
        $display->playButton($track);
        echo " ";
        $dispname = '';
        $meta = $track->getMeta();
        if (!isNothing($meta['number'])) {
            $dispname .= $meta['number'] . ' ';
        }
        $dispname .= $track->getName();
        $display->playLink($track, $dispname, "Play " . $track->getName());
        echo '</td>';
        $c2++;
        if ($c2 % $num_track_cols == 0) {
            echo '</tr>';
        }
    }
    while ($c2 % $num_track_cols != 0) {
        $c2++;
        echo '<td class="jz_nj_block_body">&nbsp;</td>';
    }
    ?>
		     </tr>
		     </table>
			 </form>
			 </td>
			 </tr>
			 </table>
			 
			 <?php 
}
Example #9
0
// See if they ran a search.
if ($search != "") {
    // Now let's get all the genres from our cache file
    $root =& new jzMediaNode();
    $matches = $root->search($search, "nodes", distanceTo("album"));
    // arrayify search.
    echo '<select name="' . jz_encode("chosenPath") . '"size="18" class="jz_select" style="width: 200px" onChange="submit()">';
    for ($i = 0; $i < count($matches); $i++) {
        $parent = $matches[$i]->getNaturalParent();
        echo '<option value="' . jz_encode(htmlentities($matches[$i]->getPath("String"))) . '">' . $matches[$i]->getName() . " (" . $parent->getName() . ")";
    }
    echo "</select>";
} else {
    if (isset($_GET['a'])) {
        // Now let's get all the artists from our cache file
        $root =& new jzMediaNode();
        $matches = $root->getAlphabetical($_GET['a'], "nodes", distanceTo("album"));
        echo '<select name="' . jz_encode("chosenPath") . '"size="15" class="jz_select" style="width: 200px" onChange="submit()">';
        for ($i = 0; $i < count($matches); $i++) {
            $parent = $matches[$i]->getNaturalParent();
            echo '<option value="' . jz_encode(htmlentities($matches[$i]->getPath("String"))) . '">' . $matches[$i]->getName() . " (" . $parent->getName() . ")";
        }
        echo '</select>';
    }
}
echo "</form>";
echo "<br><br>";
$this->closeButton();
echo "</center>";
$this->closeBlock();
exit;
Example #10
0
function keepVars($GET)
{
    if (isset($GET['query'])) {
        echo "<input type=\"hidden\" name=\"query\" value=\"" . htmlentities($GET['query']) . "\">";
    }
    if ($GET['how'] == "filter") {
        echo "<input type=\"hidden\" name=\"" . jz_encode("how") . "\" value=\"" . jz_encode("filter") . "\">";
    }
    if ($GET['how'] == "search") {
        echo "<input type=\"hidden\" name=\"" . jz_encode("how") . "\" value=\"" . jz_encode("search") . "\">";
    }
}
Example #11
0
echo jz_encode('addList');
?>
' || button.name == '<?php 
echo jz_encode('addPath');
?>
') {
    ajax_submit_form(form,url,updatePlaylist_cb);
    return false;
  }

  if (button.name == '<?php 
echo jz_encode('downloadlist');
?>
' ||
      button.name == '<?php 
echo jz_encode('createlist');
?>
'
      ){
    button.click();
    return false;
  }

  if (playback == 'stream') {
    form.submit();
    return false;
  } else if (playback == 'jukebox') {
    for (i=0;i<form.elements.length;i++) {
      if (form.elements[i].name=='jz_playlist') {
        var pl_id = form.elements[i].value;
        var pl_url = url + "&action=playlist&type=playlist&jz_pl_id="+pl_id;
Example #12
0
echo '</td><td>';
echo '<select name="' . jz_encode("newPType") . '" class="jz_select">';
echo '<option value="' . jz_encode("unchanged") . '">' . word("Unchanged") . '</option>';
echo '<option value="' . jz_encode("genre") . '">' . word("Genre") . '</option>';
echo '<option value="' . jz_encode("artist") . '">' . word("Artist") . '</option>';
echo '<option value="' . jz_encode("album") . '">' . word("Album") . '</option>';
echo '<option value="' . jz_encode("disk") . '">' . word("Disk") . '</option>';
echo '<option value="' . jz_encode("generic") . '">' . word("Generic") . '</option>';
echo '</select>';
echo '</td></tr>';
$i = 1;
while ($node->getSubNodeCount("nodes", $i) > 0) {
    echo "<tr><td>Level {$i}:</td><td>";
    echo '<select name="' . jz_encode("newPType-{$i}") . '" class="jz_select">';
    echo '<option value="' . jz_encode("unchanged") . '">' . word("Unchanged") . '</option>';
    echo '<option value="' . jz_encode("genre") . '">' . word("Genre") . '</option>';
    echo '<option value="' . jz_encode("artist") . '">' . word("Artist") . '</option>';
    echo '<option value="' . jz_encode("album") . '">' . word("Album") . '</option>';
    echo '<option value="' . jz_encode("disk") . '">' . word("Disk") . '</option>';
    echo '<option value="' . jz_encode("generic") . '">' . word("Generic") . '</option>';
    echo '</select></td></tr>';
    $i++;
}
echo "</table>";
echo '<br><input type="submit" name="updatePType" value="' . word("Update Type") . '" class="jz_submit">';
echo ' <input type="submit" name="edit_auto_set_ptype" value="' . word("Auto Set Page Type") . '" class="jz_submit">';
echo " ";
$this->closeButton();
echo '</form>';
$this->closeBlock();
exit;
Example #13
0
    if (distanceTo('genre') !== false || distanceTo('artist') !== false) {
        echo '<td valign="top">' . word('from:') . '</td>';
        echo '<td valign="top">';
        if (distanceTo("genre") !== false) {
            $display->dropdown("genre", false, "source1");
        }
        if (distanceTo("genre") !== false && distanceTo("artist") !== false) {
            echo '<br>';
        }
        if (distanceTo("artist") !== false) {
            echo $display->dropdown("artist", false, "source2");
        }
        echo '</td>';
        echo '</td></tr></table><br>';
        echo '<table align="center" border="0" cellspacing="0"><tr><td>';
        echo '<input type="submit" class="jz_submit" name="' . jz_encode('addrule') . '" value="' . word('Add Rule') . '">';
        echo ' &nbsp;';
        echo '<input type="submit" name="deletePlaylist" value="' . word("Delete Playlist") . '" class="jz_submit">';
        echo '</td></tr></form>';
    }
    $this->closeBlock();
    return;
}
// Now let's get the list into an array
$plist = $jzUSER->loadPlaylist($_SESSION['jz_playlist']);
/*if ($plist == "") {
	exit ();
}*/
$plist->flatten();
$list = $plist->getList();
// Now we need to see if they deleted a track or not
Example #14
0
    $root = new jzMediaNode();
    $artArray = $root->getSubNodes($what, $distance);
    for ($i = 0; $i < count($artArray); $i++) {
        $valArray[] = $artArray[$i]->getName();
    }
    echo word("Scanning full list...") . "<br><br>";
    flushdisplay();
    $found = $root->search($valArray, $what, $distance, sizeof($valArray), "exact");
    foreach ($found as $e) {
        $matches[] = $e->getName();
        echo $e->getName() . '<br>';
        flushdisplay();
    }
    $this->closeBlock();
    exit;
}
$arr = array();
$arr['action'] = "popup";
$arr['ptype'] = "dupfinder";
echo '<form action="' . urlize($arr) . '" method="POST">';
echo "<br><br>";
echo "<center>";
echo word("Please select what you would like to search for") . "<br><br><br>";
echo '<input type="submit" value="' . word("Search Artists") . '" name="' . jz_encode("searchDupArtists") . '" class="jz_submit">';
echo ' &nbsp; ';
echo '<input type="submit" value="' . word("Search Albums") . '" name="' . jz_encode("searchDupAlbums") . '" class="jz_submit">';
echo ' &nbsp; ';
echo '<input type="submit" value="' . word("Search Tracks") . '" name="' . jz_encode("searchDupTracks") . '" class="jz_submit">';
echo "</center>";
echo '</form>';
$this->closeBlock();
Example #15
0
    /**
     * Displays a table of the given tracks.
     *
     * @author Ross Carlson
     * @version 11/30/04
     * @since 01/11/05
     * @param array $tracks The array of objects of each track
     * @param $purpose The type of this track table. One of:
     * generic|album|search|sample|sample-all
     */
    function 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, $root_dir;
        if (sizeof($tracks) == 0) {
            return;
        }
        // Let's setup the new display object
        $display =& new jzDisplay();
        // Let's figure out our settings:
        // First, set the defaults.
        $showNumbers = true;
        $showArtist = false;
        $showAlbum = false;
        $showCheck = false;
        $showInfo = false;
        $showEmail = false;
        $showRate = false;
        $showDisc = false;
        $albumArtThumbs = false;
        $showAlbumNames = false;
        $trackTruncate = false;
        $showPlayCount = false;
        // Now adjust as needed:
        switch ($purpose) {
            case "generic":
                $showNumbers = false;
                break;
            case "album":
                $showCheck = true;
                $showNumbers = false;
                $showInfo = true;
                $showPlayCount = true;
                $showEmail = true;
                break;
            case "search":
                $showArtist = true;
                break;
            case "sample":
                // We only want to show album thumbs IF this artist has more than 1 album
                $parent = $tracks[0]->getParent();
                $gParent = $parent->getParent();
                $nodes = $gParent->getSubNodes("nodes");
                if (count($nodes) > 1) {
                    $albumArtThumbs = true;
                }
                $showNumbers = false;
                $showAlbum = true;
                break;
            case "sample-all":
                $showNumbers = false;
                $showCheck = true;
                $showAlbumNames = true;
                $trackTruncate = 20;
                break;
        }
        // Do we need to start the form
        if ($showCheck) {
            $node = $tracks[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");
            ?>
">
			<input type="hidden" name="<?php 
            echo jz_encode("jz_path");
            ?>
" value="<?php 
            echo htmlentities(jz_encode($node->getPath("String")));
            ?>
">
			<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 
        foreach ($tracks as $child) {
            // 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) {
                ?>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <input type="checkbox" name="jz_list[]" value="<?php 
                echo jz_encode($child->getPath("String"));
                ?>
">
		   </td>
		   
		   
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <?php 
                echo $display->playButton($child);
                ?>
		   </td>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <?php 
                echo $display->downloadButton($child);
                ?>
		   </td>
		   
		   
		   <?php 
            }
            // Do they want ratings?
            if ($enable_ratings == "true") {
                echo '<td width="1%" valign="top" class="jz_track_table_songs_td">';
                $display->rateButton($child);
                echo '</td>';
            }
            ?>
		  
		   <?php 
            if ($showInfo) {
                $arr = array();
                $arr['action'] = "popup";
                $arr['ptype'] = "trackinfo";
                $arr['jz_path'] = $child->getPath("String");
                $link = urlize($arr);
                ?>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <a href="<?php 
                echo $link;
                ?>
" target="_blank" onclick="openPopup(this, 375, 650); return false;"><?php 
                echo $img_more;
                ?>
</a>
		   </td>
		   <?php 
            }
            ?>
		   <?php 
            if ($showEmail) {
                ?>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <?php 
                $arr = array();
                $arr['action'] = "playlist";
                $arr['jz_path'] = $child->getPath("String");
                $arr['type'] = "track";
                $link = $this_site . $root_dir . "/" . str_replace("&", "%26", urlize($arr));
                $mailLink = "mailto:?subject=" . $artist . " - " . $album->getName() . "&body=Click to play " . $artist . " - " . $album->getName() . ":%0D%0A%0D%0A" . $link . "%0D%0A%0D%0APowered%20by%20Jinzora%20%0D%0AJinzora%20::%20Free%20Your%20Media%0D%0Ahttp://www.jinzora.org";
                ?>
		   <a class="jz_track_table_songs_href" href="<?php 
                echo $mailLink;
                ?>
"><?php 
                echo $img_email;
                ?>
</a>
		   </td>
		   <?php 
            }
            ?>
		   <?php 
            if ($showDisc) {
                ?>
		   <td width="1%" valign="top" class="jz_track_table_songs_td">
		   <a class="jz_track_table_songs_href" href=""><?php 
                echo $img_discuss;
                ?>
</a>
		   </td>
		   <?php 
            }
            ?>
		   <td nowrap width="100%" valign="top" class="jz_track_table_songs_td">
		   <?php 
            // Do they want tiny thumbnails?
            if ($albumArtThumbs) {
                if (($art = $album->getMainArt()) !== false) {
                    $display->link($album, $display->returnImage($art, $album->getName(), 25, 25, "limit", false, false, "left", "2", "2"), $album->getName(), "jz_track_table_songs_href");
                }
            }
            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 " / ";
                }
            }
            if (!$trackTruncate) {
                $tName = $child->getName();
            } else {
                $tName = returnItemShortName($child->getName(), $trackTruncate);
            }
            $display->link($child, $tName, $child->getName(), "jz_track_table_songs_href");
            if ($showAlbum) {
                echo "<br>From: ";
                $display->link($album, returnItemShortName($album->getName(), 20), $album->getName(), "jz_track_table_songs_href");
            }
            // 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">';
                echo "<nobr>" . $lyrics . "</nobr>";
                echo '</td>';
            }
            ?>
		   
		   
		   <?php 
            if ($showAlbumNames) {
                echo '<td width="1%" align="center" valign="top" class="jz_track_table_songs_td"><nobr>';
                $display->link($gParent, returnItemShortName($gParent->getName(), 20), $gParent->getName(), "jz_track_table_songs_href");
                echo '</nobr></td>';
            }
            ?>
		   
			<?php 
            if ($showPlayCount) {
                echo '<td width="1%" align="center" valign="top" class="jz_track_table_songs_td">';
                echo $child->getPlayCount();
                echo '</td>';
            }
            ?>
		   
		   
		   <td width="6%" align="center" valign="top" class="jz_track_table_songs_td">
		   <nobr> &nbsp; <?php 
            echo convertSecMins($metaData['length']);
            ?>
 &nbsp; </nobr>
		   </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) {
            $blocks = new jzBlocks();
            $blocks->blockSpacer();
            $blocks->playlistBar();
            echo "</form>";
        }
    }
Example #16
0
*/
global $node;
// Let's see if they rated it?
if (isset($_POST['itemRating'])) {
    // Ok, let's rate and close
    $node->addRating($_POST['itemRating']);
    $this->closeWindow(true);
}
// First let's display the top of the page and open the main block
$this->displayPageTop("", word("Rate Item") . "<br>" . $node->getName());
$this->openBlock();
// Now let's setup the values
$url_array = array();
$url_array['jz_path'] = $node->getPath("String");
$url_array['action'] = "popup";
$url_array['ptype'] = "rateitem";
echo '<form action="' . urlize($url_array) . '" method="POST">';
echo '<center><br>' . word("Rating") . ': ';
echo '<select name="' . jz_encode('itemRating') . '" class="jz_select">';
for ($i = 5; $i > 0;) {
    echo '<option value="' . jz_encode($i) . '">' . $i . '</option>';
    $i = $i - 0.5;
}
echo '</select>';
echo '<br><br><input type="submit" name="' . jz_encode('submitRating') . '" value="' . word("Rate Item") . '" class="jz_submit">';
echo " ";
$this->closeButton();
echo '</center>';
echo '</form>';
// Now let's close out
$this->closeBlock();
Example #17
0
function drawPage(&$node)
{
    global $media_dir, $jinzora_skin, $hierarchy, $album_name_truncate, $row_colors, $img_download, $img_more, $img_email, $img_play, $img_random_play, $img_rate, $img_discuss, $num_other_albums, $root_dir, $enable_ratings, $short_date, $jzUSER, $img_play_dis, $img_random_play_dis, $img_download_dis, $show_similar, $show_radio, $jzSERVICES, $show_album_art, $this_page;
    // Let's setup the new display object
    $display =& new jzDisplay();
    $blocks =& new jzBlocks();
    $fe =& new jzFrontend();
    $parent = $node->getAncestor("artist");
    ?>
			
		<table width="100%" cellpadding="5" cellspacing="0" border="0">
			<tr>
				<td>
					<table width="100%" cellpadding="5" cellspacing="0" border="0">
						<tr>
							<td class="jz_block_td" nowrap colspan="4">
								<strong>SEARCH RESULTS AND OPTIONS</strong>
							</td>
						</tr>
						<tr>
							<?php 
    if (($art = $node->getMainArt("100x100")) !== false) {
        echo '<td width="1%" class="jz_nj_block_body" align="center" rowspan="2">';
        $display->playLink($node, $display->returnImage($art, $node->getName(), 100, 100, "fit"));
        echo '</td>';
    }
    ?>
							<td width="33%" class="jz_nj_block_body" align="center">
								<?php 
    echo $node->getSubNodeCount();
    ?>
 Track(s) Found.
							</td>
							<td width="33%" class="jz_nj_block_body" align="center">
								Page 1 of 1
							</td>
							<td width="33%" class="jz_nj_block_body" align="center">
								<?php 
    $stats = $node->getStats();
    echo $stats['total_length_str'];
    echo " for ";
    echo $stats['total_size_str'];
    ?>
							</td>
						</tr>
						<tr>
							<td width="25%" class="jz_nj_block_body" align="center">
								<a onClick="CheckBoxes('tracklist',true);" href="javascript:void()">Select All</a>
							</td>
							<td width="25%" class="jz_nj_block_body" align="center">
								<a onClick="CheckBoxes('tracklist',false);" href="javascript:void()">Release All</a>
							</td>
							<td width="25%" class="jz_nj_block_body" align="center">
									<a onClick="document.tracklist.randomize.value = 'false'; <?php 
    echo $display->embeddedFormHandler('tracklist');
    ?>
 document.tracklist.submit();" href="javascript:void()"><?php 
    echo word('Play');
    ?>
</a>
									 | 
									<a onClick="document.tracklist.randomize.value = 'true';  <?php 
    echo $display->embeddedFormHandler('tracklist');
    ?>
 document.tracklist.submit();" href="javascript:void()"><?php 
    echo word('Randomize');
    ?>
</a>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		
		<table width="100%" cellpadding="5" cellspacing="0" border="0">
			<tr>
				<td>
					<table width="100%" cellpadding="5" cellspacing="0" border="0">
						<tr>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
							
							</td>
							<td width="25%" align="center" class="jz_nj_block_body" style="border-top: 1px solid black;">
								<a href="#pageBottom">To Bottom</a>
							</td>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
								
							</td>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
							
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>

		<table width="100%" cellpadding="5" cellspacing="0" border="0">
			<tr>
				<td>
					<table width="100%" cellpadding="3" cellspacing="0" border="0">
						<tr>
							<td class="jz_block_td" nowrap>
								<strong>Options</strong>
							</td>
							<td class="jz_block_td" nowrap>
								<strong>Track Name</strong>
							</td>
							<td class="jz_block_td" nowrap>
								<strong>Time</strong>
							</td>
							<td class="jz_block_td" nowrap>
								<strong>Artist</strong>
							</td>
							<td class="jz_block_td" nowrap>
								<strong>Album</strong>
							</td>
							<td class="jz_block_td" nowrap align="center">
								<strong>#</strong>
							</td>
							<td class="jz_block_td" nowrap>
								<strong>Genre</strong>
							</td>
						</tr>
						
						<form name="tracklist" method="POST" action="<?php 
    echo urlize(array());
    ?>
">
						<input type="hidden" name="<?php 
    echo jz_encode("action");
    ?>
" value="<?php 
    echo jz_encode("mediaAction");
    ?>
">
						<input type="hidden" name="<?php 
    echo jz_encode("jz_path");
    ?>
" value="<?php 
    echo htmlentities(jz_encode($node->getPath("String")));
    ?>
">
						<input type="hidden" name="<?php 
    echo jz_encode("jz_list_type");
    ?>
" value="<?php 
    echo jz_encode("tracks");
    ?>
">
							    <input type="hidden" name="<?php 
    echo jz_encode("sendList");
    ?>
" value="<?php 
    echo jz_encode("true");
    ?>
">
							    <input type="hidden" name="randomize" value="false">
						<?php 
    $tracks = $node->getSubNodes('tracks', -1);
    foreach ($tracks as $track) {
        $meta = $track->getMeta();
        echo '<tr><td nowrap width="1%" class="jz_nj_block_body" valign="top">';
        echo '<input type="checkbox" name="jz_list[]" value="' . jz_encode($track->getPath("String")) . '" style="width:10px;height:10px;">';
        $display->playButton($track);
        echo " ";
        $display->downloadButton($track);
        echo '</td><td class="jz_nj_block_body" >';
        $display->playLink($track, $track->getName(), "Play " . $track->getName());
        echo '</td><td width="1%" class="jz_nj_block_body" align="center">';
        echo convertSecMins($meta['length']);
        echo '</td><td class="jz_nj_block_body" >';
        $artist = $track->getAncestor("artist");
        if ($artist) {
            $display->playButton($artist);
            echo " ";
            $display->randomPlayButton($artist);
            echo " ";
            $display->link($artist, $artist->getName());
        } else {
            echo $meta['artist'];
        }
        echo '</td><td class="jz_nj_block_body" >';
        $display->playButton($node);
        echo " ";
        $display->randomPlayButton($node);
        echo " ";
        $display->downloadButton($node);
        echo " ";
        $display->link($node, $node->getName());
        echo '</td><td nowrap width="1%" align="center" class="jz_nj_block_body" >';
        echo $meta['number'];
        echo '</td><td class="jz_nj_block_body" >';
        if ($artist === false) {
            $genre = false;
        } else {
            $genre = $artist->getAncestor("genre");
        }
        if ($genre) {
            $display->playButton($genre);
            echo " ";
            $display->randomPlayButton($genre);
            echo " ";
            $display->link($genre, $genre->getName());
        } else {
            if (!isNothing($meta['genre'])) {
                echo $meta['genre'];
            } else {
                echo '&nbsp;';
            }
        }
        echo '</td></tr>';
    }
    ?>
					</table>
					</form>
				</td>
			</tr>
		</table>

		<table width="100%" cellpadding="5" cellspacing="0" border="0">
			<tr>
				<td>
					<table width="100%" cellpadding="5" cellspacing="0" border="0">
						<tr>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
							
							</td>
							<td width="25%" align="center" class="jz_nj_block_body" style="border-top: 1px solid black;">
								<a href="#pageTop">To Top</a>
							</td>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
								
							</td>
							<td width="25%" class="jz_nj_block_body" style="border-top: 1px solid black;">&nbsp;
							
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<?php 
}
Example #18
0
 /** Displays a hidden field for the given variable
  * if it is currently set via post/get vars, it keeps that value
  * or it may be set to the given value.
  *
  * @author Ben Dodson
  */
 function hiddenVariableField($type, $value = false, $encode = true, $return = false)
 {
     if ($value !== false) {
         if ($encode) {
             $retVal = '<input type="hidden" name="' . htmlentities(jz_encode($type)) . '" value="' . htmlentities(jz_encode($value)) . '">';
         } else {
             $retVal = '<input type="hidden" name="' . htmlentities($type) . '" value="' . htmlentities($value) . '">';
         }
     } else {
         if (isset($_POST[$type])) {
             if ($encode) {
                 $retVal = '<input type="hidden" name="' . jz_encode($type) . '" value="' . jz_encode($_POST[$type]) . '">';
             } else {
                 $retVal = '<input type="hidden" name="' . $type . '" value="' . $_POST[$type] . '">';
             }
         } else {
             if (isset($_GET[$type])) {
                 if ($encode) {
                     $retVal = '<input type="hidden" name="' . jz_encode($type) . '" value="' . jz_encode($_GET[$type]) . '">';
                 } else {
                     $retVal = '<input type="hidden" name="' . $type . '" value="' . $_GET[$type] . '">';
                 }
             }
         }
     }
     if ($return) {
         return $retVal;
     } else {
         echo $retVal;
     }
 }
Example #19
0
}
if ($_GET['subpage'] == "frontend" && !isset($page_array['set_fe'])) {
    ?>
 <form method="POST" action="<?php 
    echo urlize($page_array);
    ?>
">
    <select class="jz_select" name="<?php 
    echo jz_encode('set_fe');
    ?>
">Frontend: 
   <?php 
    $arr = readDirInfo($include_path . 'frontend/frontends', "dir");
    foreach ($arr as $a) {
        if (file_exists($include_path . "frontend/frontends/{$a}/settings.php")) {
            echo "<option value=\"" . jz_encode($a) . "\"";
            if ($a == $my_frontend) {
                echo ' selected';
            }
            echo ">{$a}</option>";
        }
    }
    ?>
   </select>
       &nbsp;<input type="submit" class="jz_submit" value="<?php 
    echo word('Go');
    ?>
">
		<?php 
    $this->closeBlock();
    return;
Example #20
0
    echo '<input type="hidden" name="return" value="' . $_GET['return'] . '">';
}
// See if they ran a search.
if ($search != "") {
    // Now let's get all the genres from our backend
    $root =& new jzMediaNode();
    $matches = $root->search($search, "nodes", distanceTo("artist"));
    // arrayify search.
    echo '<select name="' . jz_encode("chosenPath") . '"size="18" class="jz_select" style="width: 200px" onChange="submit()">';
    for ($i = 0; $i < count($matches); $i++) {
        echo '<option value="' . jz_encode($matches[$i]->getPath("String")) . '">' . $matches[$i]->getName();
    }
    echo "</select>";
} else {
    if (isset($_GET['i'])) {
        // Now let's get all the artists from our cache file
        $root =& new jzMediaNode();
        $matches = $root->getAlphabetical($_GET['i'], "nodes", distanceTo("artist"));
        echo '<select name="' . jz_encode("chosenPath") . '"size="18" class="jz_select" style="width: 200px" onChange="submit()">';
        for ($i = 0; $i < count($matches); $i++) {
            echo '<option value="' . jz_encode($matches[$i]->getPath("String")) . '">' . $matches[$i]->getName();
        }
        echo '</select>';
    }
}
echo "</form>";
echo "<br><br>";
$this->closeButton();
echo "</center>";
$this->closeBlock();
exit;
Example #21
0
					<tr class="<?php 
echo $row_colors[$i];
$i = 1 - $i;
?>
">
						<td width="100%" colspan="2" valign="top" align="center">
							<br><br>
							<input type=submit class="jz_submit" name="<?php 
echo jz_encode('closeupdate');
?>
" value="<?php 
echo word("Update & Close");
?>
">
							<input type=submit class="jz_submit" name="<?php 
echo jz_encode('updatedata');
?>
" value="<?php 
echo word("Update");
?>
">
							<?php 
if ($resize_images = "true") {
    //echo '<input type=submit class="jz_submit" name="edit_rotate_image" value="'. word("Rotate Image"). '">';
}
echo "<br><br>";
$this->closeButton();
?>
							<br><br><br>
						</td>
					</tr>
Example #22
0
}
// Now we need to cut the last item off the list
$bcArray = array_slice($bcArray, 0, count($bcArray) - 1);
$bread_crumbs = '<form action="' . $this_page . '" method="' . $mode . '">' . "\n";
$bread_crumbs .= '<select style="width:175px" class="jz_select" name="' . jz_encode('jz_path') . '" onChange="form.submit();">' . "\n";
$parent = $node->getParent();
$nodes = $parent->getSubNodes("nodes");
sortElements($nodes);
foreach ($nodes as $child) {
    $path = $child->getPath("String");
    $bread_crumbs .= '<option ';
    // Is this the current one?
    if ($child->getName() == $node->getName()) {
        $bread_crumbs .= ' selected ';
    }
    $bread_crumbs .= 'value="' . jz_encode($path) . '">' . $display->returnShortName($child->getName(), 20) . '</option>' . "\n";
}
$bread_crumbs .= '</select>' . "\n";
//$display->hiddenVariableField("jz_path");
$bread_crumbs .= $display->hiddenPageVars(true);
$bread_crumbs .= '<input type="hidden" name="frontend" value="' . $_GET['frontend'] . '">' . "\n";
$bread_crumbs .= "</form>";
$smarty->assign('bread_crumbs', $bread_crumbs);
$smarty->assign('play_button', $display->playButton($node, false, false, false, true));
$smarty->assign('random_button', $display->randomPlayButton($node, false, false, false, true));
$url_array = array();
$url_array['jz_path'] = $node->getPath("String");
$url_array['action'] = "popup";
$url_array['ptype'] = "iteminfo";
$smarty->assign('info_button', urlize($url_array));
$smarty->assign('allow_resample', "false");
Example #23
0
    /**
     * Draws the login page.
     * 
     * @author Ben Dodson <bdodson@seas.upenn.edu>
     * @version 11/3/04
     * @since 5/13/04
     */
    function loginPage($failed = false)
    {
        $display =& new jzDisplay();
        //$display->preHeader('Login',$this->width,$this->align);
        echo '<body onLoad="document.getElementById(\'loginform\').field1.focus();"></body>';
        $urla = array();
        $urla['jz_path'] = isset($_GET['jz_path']) ? $_GET['jz_path'] : '';
        ?>
				<style>
					body {
						background-color: #F5F5D0;
						background: #F5F5D0;
						font-family: Verdana, Sans;
						font-size: 10px;
						color: #9c9b9b;
						margin: 0 0 0 0;
					}
					td {
						font-family: Verdana, Sans;
						font-size: 10px;
					}
					submit {
						border: 1px solid black;
						background: #EFEFCC;
						color: #000000;
						font-size: 11px;
						border-width: 1px;
					}
					input {
						font-family: Verdana, Sans;
						color: #000000;
						background-color: #EFEFCC;
						font-size: 11px;
						border-width: 1px;
					}
				</style>
				    <script language="javascript" src="lib/md5.js"></script>
				    <script language="javascript">
				    function submitLogin() {
				      if (document.getElementById("loginform").doregister.value == 'true') {
					return true;
				      } else {
					// submit the other form
					// so we can submit a non-cleartext PW without changing browser's stored PW.
					document.getElementById("loginSecureForm").field1.value = 
					         document.getElementById("loginform").field1.value;

					document.getElementById("loginSecureForm").field2.value = 
					hex_md5(document.getElementById("loginform").field2.value);

					document.getElementById("loginSecureForm").remember.value =
					document.getElementById("loginform").remember.value;

					document.getElementById("loginSecureForm").submit();
					return false;
				      }
				    }
				    </script>
				<body style="background-color: #F5F5D0;">
				<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0" style="background-color: #F5F5D0;">
					<tr>
						<td align="center" height="100%" width="100%" style="background-color: #F5F5D0;">
							<?php 
        if ($failed) {
            echo "<center><strong><font color=white>Incorrect password</font></strong></center>";
        }
        ?>
							<form name="loginSecureForm" id="loginSecureForm" method="POST" action="<?php 
        echo urlize($urla);
        ?>
">
								<input type="hidden" name="field1" value="">
								<input type="hidden" name="field2" value="">
	                            <input type="hidden" name="remember" value="">
								<input type="hidden" name="<?php 
        echo jz_encode('action');
        ?>
" value="<?php 
        echo jz_encode('login');
        ?>
">
                            </form>
							<form name="loginform" id="loginform" method="POST" action="<?php 
        echo urlize($urla);
        ?>
" onsubmit="return submitLogin()">
								<input type="hidden" name="<?php 
        echo jz_encode('action');
        ?>
" value="<?php 
        echo jz_encode('login');
        ?>
">
								<?php 
        if (!$failed) {
            echo "<br><br><br>";
        }
        ?>
								<?php 
        echo word("Username");
        ?>
<br>
								<input size="18" type="text" class="jz_input" name="field1" style="width:146px;">
								<br>
								<?php 
        echo word("Password");
        ?>
<br>
								<input size="18" type="password" class="jz_input" name="field2" style="width:146px;">
								<br>
								<input type="checkbox" class="jz_checkbox" name="remember"> <?php 
        echo word("Remember me");
        ?>
								<br><br>
								<input class="jz_submit" type="submit" name="<?php 
        echo jz_encode('submit_login');
        ?>
" value="<?php 
        echo word("Login");
        ?>
">
								   <input type="hidden" name="doregister" value="false" />
								<?php 
        $be = new jzBackend();
        $data = $be->loadData('registration');
        if ($data['allow_registration'] == "true") {
            ?>
										&nbsp;<input class="jz_submit" type="submit" name="<?php 
            echo jz_encode('self_register');
            ?>
" value="<?php 
            echo word("Register");
            ?>
" onclick="document.getElementById('loginform').doregister.value='true'">
									<?php 
        }
        ?>

							</form>
							<br /><br />
							<img src="style/images/login-footer-logo.gif" border="0">
							<br /><br />
						</td>
					</tr>
				</table>
				</body>
			<?php 
        //this->footer();
    }
Example #24
0
    $link .= " selected ";
}
$link .= 'value="' . jz_encode("0") . '">1</option>' . "\n";
// Now let's dynamically do all the middle ones
$i = 0;
$e = 0;
$c = 1;
while ($i < count($artArray)) {
    if ($e == "24") {
        $e = 0;
        $c++;
        $link .= '<option ';
        if ($_POST['page'] + 1 == $c) {
            $link .= " selected ";
        }
        $link .= 'value="' . jz_encode($c - 1) . '">' . $c . '</option>' . "\n";
    }
    $i++;
    $e++;
}
$link .= '</select></form>';
$link .= "&nbsp; &nbsp;";
$smarty->assign('title', word("All Album Art"));
$smarty->assign('title_right', $link);
//$this->blockHeader(word("All Album Art"), $link);
//$this->blockBodyOpen();
// Now let's slice this up into pages
if (isset($_POST['page'])) {
    if ($_POST['page'] == "RANDOM") {
        $start = 1 * 24;
        shuffle($artArray);
Example #25
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);
    }
Example #26
0
        echo word('Create Lo-Fi');
        ?>
">  
						<input type=submit class="jz_submit" name="<?php 
        echo jz_encode('createclip');
        ?>
" value="<?php 
        echo word('Create Clip');
        ?>
"> 
						<br><br>
						<?php 
    }
    ?>
					<?php 
}
?>
					<input type=submit class="jz_submit" name="<?php 
echo jz_encode('justclose');
?>
" value="<?php 
echo word('Close');
?>
">
					<br><br>
				</td>
			</tr>
		</table>
		</form>
		<?php 
$this->closeBlock();
Example #27
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>";
        }
    }
Example #28
0
							<input value="always" type="radio" name="edit_search_year_miss"> <?php 
    echo word("Always");
    ?>
						</td>
					</tr>
				</table>
				<br>
				<input type="submit" name="<?php 
    echo jz_encode("metaSearchSubmit");
    ?>
" value="<?php 
    echo word("Search");
    ?>
" class="jz_submit">
				<!--<input type="submit" name="<?php 
    echo jz_encode("edit_meta_search_step");
    ?>
" value="<?php 
    echo word("Search");
    ?>
" class="jz_submit">-->
			</form>
			<?php 
    $this->closeButton();
    $this->closeBlock();
    exit;
}
// Did they want to verify the search?
if (isset($_POST['edit_meta_search_step'])) {
    $this->stepMetaSearch($node);
}