当前位置: 首页>>代码示例>>PHP>>正文


PHP Emails::get_by_id方法代码示例

本文整理汇总了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)));
}
开发者ID:radiowarwick,项目名称:digiplay,代码行数:6,代码来源:emailmessage.php

示例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) {
开发者ID:radiowarwick,项目名称:digiplay,代码行数:31,代码来源:functions.php


注:本文中的Emails::get_by_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。