本文整理汇总了PHP中Emails::get_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Emails::get_by_id方法的具体用法?PHP Emails::get_by_id怎么用?PHP Emails::get_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emails
的用法示例。
在下文中一共展示了Emails::get_by_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?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: foreach
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) {