コード例 #1
0
<?php

if (is_numeric($_GET['id']) && Session::is_group_user("Email Viewer")) {
    $email = Emails::get_by_id($_REQUEST['id']);
    echo json_encode(array("subject" => $email->get_subject(), "sender" => $email->get_sender(), "message" => $email->get_body_formatted(false)));
}
コード例 #2
0
ファイル: functions.php プロジェクト: radiowarwick/digiplay
         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 = "";
     foreach ($playlists as $playlist) {
         $return .= "\r\n\t\t\t\t<div class=\"panel panel-default\">\r\n\t\t\t\t\t<div class=\"panel-heading\" data-toggle=\"collapse\" href=\"#playlist-" . $playlist->get_id() . "\">\r\n\t\t\t\t\t\t<h4 class=\"panel-title\">" . Bootstrap::glyphicon("play-circle") . $playlist->get_name() . "</h4>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div id=\"playlist-" . $playlist->get_id() . "\" class=\"panel-collapse collapse\">\r\n\t\t\t\t\t\t<table class=\"table table-striped table-hover\">\r\n\t\t\t\t\t\t\t<thead>\r\n\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t<th class=\"icon\"></th>\r\n\t\t\t\t\t\t\t\t\t<th class=\"artist\">Artist</th>\r\n\t\t\t\t\t\t\t\t\t<th class=\"title\">Title</th>\r\n\t\t\t\t\t\t\t\t\t<th class=\"album\">Album</th>\r\n\t\t\t\t\t\t\t\t\t<th class=\"length\">Length</th>\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</thead>\r\n\t\t\t\t\t\t\t<tbody>";
         foreach ($playlist->get_tracks() as $track) {
             $lastLogged = LogItems::get_by_audioid($track->get_id());
             $trackHotness = "";
             // default at 0
             if (isset($lastLogged)) {
                 $lastPlay = $lastLogged->get_datetime();
                 if ($lastPlay > time() - 604800) {