示例#1
0
<?php

Output::set_title("Emails to the Studio");
$limit = isset($_GET['n']) ? $_GET['n'] : 10;
$page = isset($_REQUEST['p']) ? $_REQUEST['p'] : 1;
$emails = Emails::get(NULL, NULL, NULL, $limit, ($page - 1) * $limit);
$pages = new Paginator();
$pages->items_per_page = $limit;
$pages->mid_range = 3;
$pages->items_total = Emails::count();
$pages->paginate();
$low = ($page - 1) * $limit + 1;
$high = $low + $limit - 1 > 200 ? 200 : $low + $limit - 1;
?>
<style type="text/css">
.subject, .sender { display:block; word-wrap: break-word; width: 100%; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
.subject { font-weight:bold; }
.sender { font-size:0.8em; }
small { display:block; margin-bottom:10px; }
#message { overflow:auto; }
tbody tr { cursor:pointer; }
.pagination { text-align: center; }
</style>
<script type="text/javascript">
$(function(){
	$('tbody tr').click(function(){
		$.getJSON('../ajax/emailmessage.php?id='+$(this).attr('data-dps-email-id'), function(data) {
			$('#message').html('<div class="panel-heading"><h4>'+data.subject+'</h4><h5>'+data.sender+'</h5></div><div class="panel-body">'+data.message+'</div>');
		});
	});
	$('#message').height($('#messagelist table').height()-20);
示例#2
0
             if ($censor_time && $track->is_censored() && $location->get_id() != $prerecord_location) {
                 continue;
             }
             $return .= "<tr data-track-id=\"" . $track->get_id() . "\" class=\"track " . $trackHotness . "\">\r\n\t\t\t\t\t<td class=\"icon\">" . ($track->is_censored() ? "<span style=\"color: rgb(219, 53, 53);\">" . Bootstrap::glyphicon("exclamation-sign") . "</span>" : Bootstrap::glyphicon("music")) . "</td>\r\n\t\t\t\t\t<td class=\"artist nowrap\">" . $track->get_artists_str() . "</td>\r\n\t\t\t\t\t<td class=\"title nowrap\">" . $track->get_title() . "</td>\r\n\t\t\t\t\t<td class=\"album nowrap\">" . $track->get_album()->get_name() . "</td>\r\n\t\t\t\t\t<td class=\"length nowrap\">" . Time::format_succinct($track->get_length()) . "</td>\r\n\t\t\t\t</tr>";
         }
         $return .= "</tbody></table>";
         if ($search["total"] > $search_limit) {
             $return .= "<span class=\"result-limit\">Only showing top " . $search_limit . " results out of " . $search["total"] . " total.  Try a more specific search.</span>";
         }
         echo $return;
     } else {
         echo "<h3>No results found, or your search term was too generic.  <br />Try a different search query.</h3>";
     }
     break;
 case "messages":
     $emails = Emails::get(NULL, NULL, NULL, 25, NULL);
     $return = "<table class=\"table table-striped table-hover\">\r\n\t\t\t<thead>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<th class=\"icon\"></th>\r\n\t\t\t\t\t<th class=\"from\">From</th>\r\n\t\t\t\t\t<th class=\"subject\">Subject</th>\r\n\t\t\t\t\t<th class=\"datetime\">Date/Time</th>\r\n\t\t\t\t</tr>\r\n\t\t\t</thead>\r\n\t\t\t<tbody>";
     foreach ($emails as $email) {
         $return .= "<tr data-message-id=\"" . $email->get_id() . "\">\r\n\t\t\t\t<td class=\"icon\">" . ($email->get_new_flag() ? Bootstrap::glyphicon("envelope") : "") . "</td>\r\n\t\t\t\t<td class=\"from nowrap\">" . $email->get_sender() . "</td>\r\n\t\t\t\t<td class=\"subject nowrap\">" . $email->get_subject() . "</td>\r\n\t\t\t\t<td class=\"datetime nowrap\">" . date("d/m/y H:i", $email->get_datetime()) . "</td>\r\n\t\t\t</tr>";
     }
     $return .= "</tbody></table>";
     echo $return;
     break;
 case "message":
     $message = Emails::get_by_id($_REQUEST['id']);
     echo $message->get_body_formatted();
     $message->mark_as_read();
     break;
 case "playlists":
     $playlists = Playlists::get_all(false);
     $return = "";