/** * Shows the chart system * * @author Ross Carlson * @version 01/26/05 * @since 01/26/05 * @param $node The node we are viewing so we can filter * @param $types The charts to display. Comma seperated list of: * topplayalbum, topplayartist, topdownalbum, newalbums, newartists, newtracks * recentplayalbum, recentplayartist, recentplaytrack, * topratedalbum, topratedartist, topviewartist, topplaytrack * @param $numItems The number of items we want to return (defaults to 5) * @param $format Should we format this or return raw data (defaults to true) * @param $opts an array of extra options (transitioning to new parameter scheme) * */ function showCharts($node, $types = false, $numItems = false, $format = true, $vertAlign = false, $opts = false) { global $album_name_truncate, $img_tiny_play, $img_tiny_play_dis, $jzUSER, $img_rss, $root_dir, $advanced_tooltips, $rss_in_charts, $num_items_in_charts, $chart_timeout_days, $chart_types; $be = new jzBackend(); if ($be->hasFeature('charts') === false) { return; } // Let's setup our objects $blocks = new jzBlocks(); $display = new jzDisplay(); $nobr = true; if ($opts !== false) { if (isset($opts['allow_breaks'])) { $nobr = false; } else { $nobr = true; } } // Now let's do a loop creating all our blocks if ($types === false || $types == "") { if (isset($chart_types) && !isNothing($chart_types)) { $b = $chart_types; } else { $b = "topplayalbum,topplayartist,topviewartist,newalbums"; } } else { $b = $types; } $bArray = explode(",", $b); for ($e = 0; $e < count($bArray); $e++) { // Now let's create our blocks $showPlays = false; switch ($bArray[$e]) { case "topplayalbum": $func = "getMostPlayed"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "played-albums"; $title = word("Top Played Albums"); $distance = "album"; $showPlays = true; $showDownload = false; $rss = "most-played"; break; case "topplayartist": $func = "getMostPlayed"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "played-artists"; $title = word("Top Played Artists"); $distance = "artist"; $showPlays = true; $showDownload = false; $rss = "most-played-artist"; break; case "topdownalbum": $func = "getMostDownloaded"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "downloaded-albums"; $title = word("Top Downloaded Albums"); $distance = "album"; $showDownload = true; $rss = "most-downloaded"; break; case "newalbums": $func = "getRecentlyAdded"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "new-albums"; $title = word("New Albums"); $distance = "album"; $showDownload = false; $rss = "last-added"; break; case "newartists": $func = "getRecentlyAdded"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "new-artists"; $title = word("New Artists"); $distance = "artist"; $showDownload = false; $rss = "last-added-artists"; break; case "newtracks": $func = "getRecentlyAdded"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "new-tracks"; $title = word("New Tracks"); $distance = "track"; $showDownload = false; $rss = "last-added-tracks"; break; case "recentplaytrack": $func = "getRecentlyPlayed"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "recentplayed-tracks"; $title = word("Recently Played Tracks"); $distance = "track"; $showDownload = false; $rss = "recentplayed-track"; break; case "topplaytrack": $func = "getMostPlayed"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "played-tracks"; $title = word("Top Played Tracks"); $distance = "track"; $showDownload = false; $rss = "most-played-tracks"; break; case "recentplayalbum": $func = "getRecentlyPlayed"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "recentplayed-albums"; $title = word("Recently Played Albums"); $distance = "album"; $showDownload = false; $rss = "recentplayed-album"; break; case "recentplayartist": $func = "getRecentlyPlayed"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "recentplayed-artists"; $title = word("Recently Played Artists"); $distance = "artist"; $showDownload = false; $rss = "recentplayed-artist"; break; case "topratedalbum": $func = "getTopRated"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "toprated-albums"; $title = word("Top Rated Albums"); $distance = "album"; $showDownload = false; $rss = "toprated-album"; break; case "topratedartist": $func = "getTopRated"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "toprated-artists"; $title = word("Top Rated Artists"); $distance = "artist"; $showDownload = false; $rss = "toprated-artist"; break; case "topviewartist": $func = "getMostViewed"; $arr['action'] = "popup"; $arr['ptype'] = "topstuff"; $arr['tptype'] = "topviewed-artists"; $title = word("Most Viewed Artists"); $distance = "artist"; $showDownload = false; $rss = "topviewed-artist"; break; default: continue; } // Now let's get the data if ($distance == "track") { $returnType = "tracks"; } else { $returnType = "nodes"; } if ($numItems) { $num_items_in_charts = $numItems; } if ($chart_timeout_days > 0) { $be = new jzBackend(); $data_id .= pathize('chart-' . $node->getPath("String")) . "-{$func}-{$distance}-{$num_items_in_charts}"; if (($recent = $be->loadData($data_id, true)) === false) { $recent = $node->{$func}($returnType, distanceTo($distance, $node), $num_items_in_charts); $be->storeData($data_id, $recent, $chart_timeout_days); } } else { $recent = $node->{$func}($returnType, distanceTo($distance, $node), $num_items_in_charts); } // Now let's see if we got data if (count($recent) == 0) { continue; } ?> <td width="25%" valign="top"> <?php if ($format) { echo '<div id="slickMainBlockBody">'; } ?> <table width="95%" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="100%" valign="middle"> <?php if ($nobr) { echo '<nobr>'; } ?> <?php if ($format) { // Now let's display the link to the FULL top played list echo '<a onclick="openPopup(this, 300, 450); return false;" title="' . $title . '" href="' . urlize($arr) . '"><strong>' . $title . '</strong></a>'; // Let's link to the RSS feed if ($rss_in_charts == "true") { echo ' - <a href="' . $root_dir . '/rss.php?type=' . $rss; if ($node->getLevel() != 0) { echo '&root=' . $node->getPath("String"); } echo '">' . $img_rss . '</a>'; } echo '<br>'; } // Now let's loop through the results for ($i = 0; $i < count($recent); $i++) { // Now let's create our node and get the properties $item = $artnode = $recent[$i]; $album = $item->getName(); $parent = $item->getAncestor("artist"); if ($parent !== false) { $artist = $parent->getName(); } $albumDLCount = $item->getDownloadCount(); $year = $item->getYear(); $dispYear = ""; if ($year != "-") { $dispYear = " (" . $year . ")"; } // Now let's create our links if ($distance == "track") { $artnode = $item->getAncestor("album"); if (is_object($artnode)) { $albumArr['jz_path'] = $artnode->getPath("String"); $gp = $item->getAncestor("artist"); if (is_object($gp)) { $artistArr['jz_path'] = $gp->getPath("String"); } else { $artistArr['jz_path'] = ''; } } else { $albumArr['jz_path'] = ''; $artistArr['jz_path'] = ''; } } else { $albumArr['jz_path'] = $item->getPath("String"); if ($parent !== false) { $artistArr['jz_path'] = $parent->getPath("String"); } } // Now let's create our short names $artistTitle = returnItemShortName($artist, $album_name_truncate); $albumTitle = returnItemShortName($album, $album_name_truncate); // Now let's display it if ($nobr) { echo "<nobr>"; } if (!$jzUSER->getSetting('stream')) { echo $img_tiny_play_dis; } else { $display->playLink($item, $img_tiny_play, $album); } // Ok, did they want advanced tooltips? if ($advanced_tooltips == "true") { // Now let's set the hover code $innerOver = ""; $showTip = false; if (($art = $artnode->getMainArt("75x75")) != false) { $innerOver .= $display->returnImage($art, $artnode->getName(), 75, 75, "limit", false, false, "left", "3", "3"); $showTip = true; $bTitle = $artist . " - " . $album . $dispYear; } else { // Ok, no art so let's make this look better $innerOver .= "<strong>" . $artist . "<br>" . $album . $dispYear . "</strong><br>"; $bTitle = $album . $dispYear; } $desc_truncate = 200; $desc = $item->getDescription(); if (!isNothing($desc)) { $innerOver .= $display->returnShortName($desc, $desc_truncate); $showTip = true; } // Now let's fix up $innerOver = str_replace("'", "", str_replace('"', "", $innerOver)); $bTitle = str_replace("'", "", str_replace('"', "", $bTitle)); if ($showTip) { $title = $display->returnToolTip($innerOver, $bTitle); } else { $title = ' title="' . $artist . ' - ' . $album . $dispYear . '"'; } } else { // Standard tooltips $title = ' title="' . $artist . ' - ' . $album . $dispYear . '"'; } echo ' <a ' . $title . ' href="' . urlize($albumArr) . '">' . $albumTitle; if ($showPlays) { if ($bArray[$e] == "topplayalbum") { $albumPlayCount = $item->getSubNodeCount('tracks', -1); if ($albumPlayCount > 0) { $albumPlayCount = ceil($item->getPlayCount() / $albumPlayCount); } } else { $albumPlayCount = $item->getPlayCount(); } echo ' (' . $albumPlayCount . ')'; } if ($showDownload) { echo ' (' . $albumDLCount . ')'; } echo "</a><br>"; if ($nobr) { echo "</nobr>"; } } if ($nobr) { echo '</nobr>'; } ?> </td> </tr> </table> <?php if ($format) { echo '</div>'; } ?> </td> <?php if ($vertAlign) { echo '</tr><tr>'; } ?> <?php } }
/** * 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; }
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> </td><td> </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 }
// Now let's set the hover code $innerOver = ""; if (($art = $item->getMainArt()) != false) { $innerOver .= $display->returnImage($art, $item->getName(), 75, 75, "limit", false, false, "left", "3", "3"); } $desc_truncate = 200; $desc = $item->getDescription(); $innerOver .= $display->returnShortName($desc, $desc_truncate); if (strlen($desc) > $desc_truncate) { $innerOver .= "..."; } $innerOver = str_replace('"', "", $innerOver); $innerOver = str_replace("'", "", $innerOver); // Now let's return our tooltip $capTitle = $artist . " - " . $album; $overCode = $display->returnToolTip($innerOver, $capTitle); echo ' <a onClick="opener.location.href=\'' . urlize($albumArr) . '\';window.close();" ' . $overCode . 'href="javascript:void()">' . $albumTitle; $cval = false; // TODO: showCount values can be: // view,dowload,play if ($showCount == "view") { $cval = $item->getViewCount(); } else { $cval = $item->getPlayCount(); } if ($cval !== false && $cval != 0) { echo ' (' . $cval . ')'; } echo "</a><br>"; // Now let's set the hover code //echo ' <a title="'. $artist. ' - '. $album. '" href="'. urlize($albumArr). '">'. $albumTitle. '</a> ('. $albumPlayCount. ')';