本文整理汇总了PHP中format_article_note函数的典型用法代码示例。如果您正苦于以下问题:PHP format_article_note函数的具体用法?PHP format_article_note怎么用?PHP format_article_note使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了format_article_note函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: setNote
function setNote()
{
$id = db_escape_string($_REQUEST["id"]);
$note = trim(strip_tags(db_escape_string($_REQUEST["note"])));
db_query("UPDATE ttrss_user_entries SET note = '{$note}'\n\t\t\tWHERE ref_id = '{$id}' AND owner_uid = " . $_SESSION["uid"]);
$formatted_note = format_article_note($id, $note);
print json_encode(array("note" => $formatted_note, "raw_length" => mb_strlen($note)));
}
开发者ID:cs-team,项目名称:tiny_tiny_rss-openshift-quickstart,代码行数:8,代码来源:init.php
示例2: format_headlines_list
//.........这里部分代码省略.........
$excerpt_hidden = "style=\"display : none\"";
}
$reply['content'] .= "<span {$excerpt_hidden}\r\n\t\t\t\t\t\tid=\"CEXC-{$id}\" class=\"cdmExcerpt\"> - {$content_preview}</span>";
$reply['content'] .= "</span>";
$reply['content'] .= "<div>";
$reply['content'] .= "<span class='updated'>{$updated_fmt}</span>";
$reply['content'] .= "{$score_pic}";
if (!get_pref($this->link, "VFEED_GROUP_BY_FEED") && $line["feed_title"]) {
$reply['content'] .= "<span style=\"cursor : pointer\"\r\n\t\t\t\t\t\t\ttitle=\"" . htmlspecialchars($line["feed_title"]) . "\"\r\n\t\t\t\t\t\t\tonclick=\"viewfeed({$feed_id})\">{$feed_icon_img}</span>";
}
$reply['content'] .= "<div class=\"updPic\">{$update_pic}</div>";
$reply['content'] .= "</div>";
$reply['content'] .= "</div>";
$reply['content'] .= "<div class=\"cdmContent\" {$content_hidden}\r\n\t\t\t\t\t\tonclick=\"return cdmClicked(event, {$id});\"\r\n\t\t\t\t\t\tid=\"CICD-{$id}\">";
$reply['content'] .= "<div class=\"cdmContentInner\">";
if ($line["orig_feed_id"]) {
$tmp_result = db_query($this->link, "SELECT * FROM ttrss_archived_feeds\r\n\t\t\t\t\tWHERE id = " . $line["orig_feed_id"]);
if (db_num_rows($tmp_result) != 0) {
$reply['content'] .= "<div clear='both'>";
$reply['content'] .= __("Originally from:");
$reply['content'] .= " ";
$tmp_line = db_fetch_assoc($tmp_result);
$reply['content'] .= "<a target='_blank'\r\n\t\t\t\t\t\t\t\thref=' " . htmlspecialchars($tmp_line['site_url']) . "'>" . $tmp_line['title'] . "</a>";
$reply['content'] .= " ";
$reply['content'] .= "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
$reply['content'] .= "<img title='" . __('Feed URL') . "'class='tinyFeedIcon' src='images/pub_set.png'></a>";
$reply['content'] .= "</div>";
}
}
$feed_site_url = $line["site_url"];
$article_content = sanitize($this->link, $line["content_preview"], false, false, $feed_site_url);
$reply['content'] .= "<div id=\"POSTNOTE-{$id}\">";
if ($line['note']) {
$reply['content'] .= format_article_note($id, $line['note']);
}
$reply['content'] .= "</div>";
$reply['content'] .= "<span id=\"CWRAP-{$id}\">";
$reply['content'] .= $expand_cdm ? $article_content : '';
$reply['content'] .= "</span>";
/* $tmp_result = db_query($this->link, "SELECT always_display_enclosures FROM
ttrss_feeds WHERE id = ".
(($line['feed_id'] == null) ? $line['orig_feed_id'] :
$line['feed_id'])." AND owner_uid = ".$_SESSION["uid"]);
$always_display_enclosures = sql_bool_to_bool(db_fetch_result($tmp_result,
0, "always_display_enclosures")); */
$always_display_enclosures = sql_bool_to_bool($line["always_display_enclosures"]);
$reply['content'] .= format_article_enclosures($this->link, $id, $always_display_enclosures, $article_content);
$reply['content'] .= "</div>";
$reply['content'] .= "<div class=\"cdmFooter\">";
$tag_cache = $line["tag_cache"];
$tags_str = format_tags_string(get_article_tags($this->link, $id, $_SESSION["uid"], $tag_cache), $id);
$reply['content'] .= "<img src='" . theme_image($this->link, 'images/tag.png') . "' alt='Tags' title='Tags'>\r\n\t\t\t\t\t\t<span id=\"ATSTR-{$id}\">{$tags_str}</span>\r\n\t\t\t\t\t\t<a title=\"" . __('Edit tags for this article') . "\"\r\n\t\t\t\t\t\thref=\"#\" onclick=\"editArticleTags({$id}, {$feed_id}, true)\">(+)</a>";
$num_comments = $line["num_comments"];
$entry_comments = "";
if ($num_comments > 0) {
if ($line["comments"]) {
$comments_url = $line["comments"];
} else {
$comments_url = $line["link"];
}
$entry_comments = "<a target='_blank' href=\"{$comments_url}\">{$num_comments} comments</a>";
} else {
if ($line["comments"] && $line["link"] != $line["comments"]) {
$entry_comments = "<a target='_blank' href=\"" . $line["comments"] . "\">comments</a>";
}
开发者ID:nvdnkpr,项目名称:Tiny-Tiny-RSS,代码行数:67,代码来源:feeds.php
示例3: format_article
//.........这里部分代码省略.........
if ($line["comments"]) {
$comments_url = htmlspecialchars($line["comments"]);
} else {
$comments_url = htmlspecialchars($line["link"]);
}
$entry_comments = "<a target='_blank' href=\"{$comments_url}\">{$num_comments} comments</a>";
} else {
if ($line["comments"] && $line["link"] != $line["comments"]) {
$entry_comments = "<a target='_blank' href=\"" . htmlspecialchars($line["comments"]) . "\">comments</a>";
}
}
if ($zoom_mode) {
header("Content-Type: text/html");
$rv['content'] .= "<html><head>\n\t\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t\t\t\t\t\t<title>Tiny Tiny RSS - " . $line["title"] . "</title>\n\t\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"tt-rss.css\">\n\t\t\t\t\t</head><body>";
}
$title_escaped = htmlspecialchars($line['title']);
$rv['content'] .= "<div id=\"PTITLE-FULL-{$id}\" style=\"display : none\">" . strip_tags($line['title']) . "</div>";
$rv['content'] .= "<div class=\"postReply\" id=\"POST-{$id}\">";
$rv['content'] .= "<div class=\"postHeader\" id=\"POSTHDR-{$id}\">";
$entry_author = $line["author"];
if ($entry_author) {
$entry_author = __(" - ") . $entry_author;
}
$parsed_updated = make_local_datetime($link, $line["updated"], true, $owner_uid, true);
$rv['content'] .= "<div class=\"postDate\">{$parsed_updated}</div>";
if ($line["link"]) {
$rv['content'] .= "<div class='postTitle'><a target='_blank'\n\t\t\t\t\ttitle=\"" . htmlspecialchars($line['title']) . "\"\n\t\t\t\t\thref=\"" . htmlspecialchars($line["link"]) . "\">" . $line["title"] . "<span class='author'>{$entry_author}</span></a></div>";
} else {
$rv['content'] .= "<div class='postTitle'>" . $line["title"] . "{$entry_author}</div>";
}
$tags_str = format_tags_string($line["tags"], $id);
$tags_str_full = join(", ", $line["tags"]);
if (!$tags_str_full) {
$tags_str_full = __("no tags");
}
if (!$entry_comments) {
$entry_comments = " ";
}
# placeholder
$rv['content'] .= "<div class='postTags' style='float : right'>\n\t\t\t\t<img src='" . theme_image($link, 'images/tag.png') . "'\n\t\t\t\tclass='tagsPic' alt='Tags' title='Tags'> ";
if (!$zoom_mode) {
$rv['content'] .= "<span id=\"ATSTR-{$id}\">{$tags_str}</span>\n\t\t\t\t\t<a title=\"" . __('Edit tags for this article') . "\"\n\t\t\t\t\thref=\"#\" onclick=\"editArticleTags({$id}, {$feed_id})\">(+)</a>";
$rv['content'] .= "<div dojoType=\"dijit.Tooltip\"\n\t\t\t\t\tid=\"ATSTRTIP-{$id}\" connectId=\"ATSTR-{$id}\"\n\t\t\t\t\tposition=\"below\">{$tags_str_full}</div>";
global $pluginhost;
foreach ($pluginhost->get_hooks($pluginhost::HOOK_ARTICLE_BUTTON) as $p) {
$rv['content'] .= $p->hook_article_button($line);
}
} else {
$tags_str = strip_tags($tags_str);
$rv['content'] .= "<span id=\"ATSTR-{$id}\">{$tags_str}</span>";
}
$rv['content'] .= "</div>";
$rv['content'] .= "<div clear='both'>{$entry_comments}</div>";
if ($line["orig_feed_id"]) {
$tmp_result = db_query($link, "SELECT * FROM ttrss_archived_feeds\n\t\t\t\t\tWHERE id = " . $line["orig_feed_id"]);
if (db_num_rows($tmp_result) != 0) {
$rv['content'] .= "<div clear='both'>";
$rv['content'] .= __("Originally from:");
$rv['content'] .= " ";
$tmp_line = db_fetch_assoc($tmp_result);
$rv['content'] .= "<a target='_blank'\n\t\t\t\t\t\thref=' " . htmlspecialchars($tmp_line['site_url']) . "'>" . $tmp_line['title'] . "</a>";
$rv['content'] .= " ";
$rv['content'] .= "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
$rv['content'] .= "<img title='" . __('Feed URL') . "'class='tinyFeedIcon' src='images/pub_set.svg'></a>";
$rv['content'] .= "</div>";
}
}
$rv['content'] .= "</div>";
$rv['content'] .= "<div id=\"POSTNOTE-{$id}\">";
if ($line['note']) {
$rv['content'] .= format_article_note($id, $line['note'], !$zoom_mode);
}
$rv['content'] .= "</div>";
$rv['content'] .= "<div class=\"postContent\">";
// N-grams
if (DB_TYPE == "pgsql" and defined('_NGRAM_TITLE_RELATED_THRESHOLD')) {
$ngram_result = db_query($link, "SELECT id,title FROM\n\t\t\t\t\t\tttrss_entries,ttrss_user_entries\n\t\t\t\t\tWHERE ref_id = id AND updated >= NOW() - INTERVAL '7 day'\n\t\t\t\t\t\tAND similarity(title, '{$title_escaped}') >= " . _NGRAM_TITLE_RELATED_THRESHOLD . "\n\t\t\t\t\t\tAND title != '{$title_escaped}'\n\t\t\t\t\t\tAND owner_uid = {$owner_uid}");
if (db_num_rows($ngram_result) > 0) {
$rv['content'] .= "<div dojoType=\"dijit.form.DropDownButton\">" . "<span>" . __('Related') . "</span>";
$rv['content'] .= "<div dojoType=\"dijit.Menu\" style=\"display: none;\">";
while ($nline = db_fetch_assoc($ngram_result)) {
$rv['content'] .= "<div onclick=\"hlOpenInNewTab(null," . $nline['id'] . ")\"\n\t\t\t\t\t\t\tdojoType=\"dijit.MenuItem\">" . $nline['title'] . "</div>";
}
$rv['content'] .= "</div></div><br/";
}
}
if ($cache_content && $line["cached_content"] != "") {
$line["content"] =& $line["cached_content"];
}
$rv['content'] .= $line["content"];
$rv['content'] .= format_article_enclosures($link, $id, $always_display_enclosures, $line["content"]);
$rv['content'] .= "</div>";
$rv['content'] .= "</div>";
}
if ($zoom_mode) {
$rv['content'] .= "\n\t\t\t\t<div style=\"text-align : center\">\n\t\t\t\t<button onclick=\"return window.close()\">" . __("Close this window") . "</button></div>";
$rv['content'] .= "</body></html>";
}
return $rv;
}
开发者ID:rclsilver,项目名称:openshift-tt-rss,代码行数:101,代码来源:functions.php
示例4: format_headlines_list
//.........这里部分代码省略.........
$reply['content'] .= "</div>";
if ($highlight_words && count($highlight_words > 0)) {
foreach ($highlight_words as $word) {
$line["title"] = preg_replace("/(\\Q{$word}\\E)/i", "<span class=\"highlight\">\$1</span>", $line["title"]);
}
}
$reply['content'] .= "<span id=\"RTITLE-{$id}\"\n\t\t\t\t\t\tonclick=\"return cdmClicked(event, {$id});\"\n\t\t\t\t\t\tclass=\"titleWrap {$hlc_suffix}\">\n\t\t\t\t\t\t<a class=\"title {$hlc_suffix}\"\n\t\t\t\t\t\ttarget=\"_blank\" href=\"" . htmlspecialchars($line["link"]) . "\">" . $line["title"] . "</a> <span class=\"author\">{$entry_author}</span>";
$reply['content'] .= $labels_str;
$reply['content'] .= "<span class='collapseBtn' style='display : none'>\n\t\t\t\t\t\t<img src=\"images/collapse.png\" onclick=\"cdmCollapseArticle(event, {$id})\"\n\t\t\t\t\t\ttitle=\"" . __("Collapse article") . "\"/></span>";
if (!$expand_cdm) {
$content_hidden = "style=\"display : none\"";
} else {
$excerpt_hidden = "style=\"display : none\"";
}
$reply['content'] .= "<span {$excerpt_hidden} id=\"CEXC-{$id}\" class=\"cdmExcerpt\">" . $content_preview . "</span>";
$reply['content'] .= "</span>";
if (!$vfeed_group_enabled) {
if (@$line["feed_title"]) {
$rgba = @$rgba_cache[$feed_id];
$reply['content'] .= "<div class=\"hlFeed\">\n\t\t\t\t\t\t\t\t<a href=\"#\" style=\"background-color: rgba({$rgba},0.3)\"\n\t\t\t\t\t\t\t\tonclick=\"viewfeed({$feed_id})\">" . truncate_string($line["feed_title"], 30) . "</a>\n\t\t\t\t\t\t\t</div>";
}
}
$reply['content'] .= "<span class='updated' title='{$date_entered_fmt}'>\n\t\t\t\t\t\t{$updated_fmt}</span>";
$reply['content'] .= "<div class='scoreWrap' style=\"vertical-align : middle\">";
$reply['content'] .= "{$score_pic}";
if (!get_pref("VFEED_GROUP_BY_FEED") && $line["feed_title"]) {
$reply['content'] .= "<span style=\"cursor : pointer\"\n\t\t\t\t\t\t\ttitle=\"" . htmlspecialchars($line["feed_title"]) . "\"\n\t\t\t\t\t\t\tonclick=\"viewfeed({$feed_id})\">{$feed_icon_img}</span>";
}
$reply['content'] .= "</div>";
$reply['content'] .= "</div>";
$reply['content'] .= "<div class=\"cdmContent\" {$content_hidden}\n\t\t\t\t\t\tonclick=\"return cdmClicked(event, {$id});\"\n\t\t\t\t\t\tid=\"CICD-{$id}\">";
$reply['content'] .= "<div id=\"POSTNOTE-{$id}\">";
if ($line['note']) {
$reply['content'] .= format_article_note($id, $line['note']);
}
$reply['content'] .= "</div>";
if (!$line['lang']) {
$line['lang'] = 'en';
}
$reply['content'] .= "<div class=\"cdmContentInner\" lang=\"" . $line['lang'] . "\">";
if ($line["orig_feed_id"]) {
$tmp_result = $this->dbh->query("SELECT * FROM ttrss_archived_feeds\n\t\t\t\t\tWHERE id = " . $line["orig_feed_id"]);
if ($this->dbh->num_rows($tmp_result) != 0) {
$reply['content'] .= "<div clear='both'>";
$reply['content'] .= __("Originally from:");
$reply['content'] .= " ";
$tmp_line = $this->dbh->fetch_assoc($tmp_result);
$reply['content'] .= "<a target='_blank'\n\t\t\t\t\t\t\t\thref=' " . htmlspecialchars($tmp_line['site_url']) . "'>" . $tmp_line['title'] . "</a>";
$reply['content'] .= " ";
$reply['content'] .= "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
$reply['content'] .= "<img title='" . __('Feed URL') . "'class='tinyFeedIcon' src='images/pub_unset.png'></a>";
$reply['content'] .= "</div>";
}
}
$reply['content'] .= "<span id=\"CWRAP-{$id}\">";
// if (!$expand_cdm) {
$reply['content'] .= "<span id=\"CENCW-{$id}\" style=\"display : none\">";
$reply['content'] .= htmlspecialchars($line["content"]);
$reply['content'] .= "</span.";
// } else {
// $reply['content'] .= $line["content"];
// }
$reply['content'] .= "</span>";
$always_display_enclosures = sql_bool_to_bool($line["always_display_enclosures"]);
$reply['content'] .= format_article_enclosures($id, $always_display_enclosures, $line["content"], sql_bool_to_bool($line["hide_images"]));
$reply['content'] .= "</div>";
开发者ID:zamentur,项目名称:ttrss_ynh,代码行数:67,代码来源:feeds.php
示例5: outputHeadlinesList
//.........这里部分代码省略.........
if ($line["feed_title"]) {
print " (<a href='javascript:viewfeed({$feed_id})'>" . $line["feed_title"] . "</a>)";
}
}
print "</span></div>";
if ($show_excerpt) {
print "<div class=\"cdmExcerpt\" id=\"CEXC-{$id}\"\n\t\t\t\t\t\t\tonclick=\"cdmExpandArticle({$id})\"\n\t\t\t\t\t\t\ttitle=\"" . __('Click to expand article') . "\">";
$content_preview = trim(truncate_string(strip_tags($line["content_preview"]), 100));
if (strlen($content_preview) != 0) {
print $content_preview;
} else {
print __('Click to expand article');
}
print "</div>";
}
print "<div class=\"cdmContent\" \n\t\t\t\t\t\tonclick=\"cdmClicked({$id})\"\n\t\t\t\t\t\tid=\"CICD-{$id}\" {$cdm_cstyle}>";
if ($line["orig_feed_id"]) {
$tmp_result = db_query($link, "SELECT * FROM ttrss_archived_feeds\n\t\t\t\t\t\tWHERE id = " . $line["orig_feed_id"]);
if (db_num_rows($tmp_result) != 0) {
print "<div clear='both'>";
print __("Originally from:");
print " ";
$tmp_line = db_fetch_assoc($tmp_result);
print "<a target='_blank' \n\t\t\t\t\t\t\thref=' " . htmlspecialchars($tmp_line['site_url']) . "'>" . $tmp_line['title'] . "</a>";
print " ";
print "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
print "<img title='" . __('Feed URL') . "'class='tinyFeedIcon' src='images/pub_set.gif'></a>";
print "</div>";
}
}
// print "<div class=\"cdmInnerContent\" id=\"CICD-$id\" $cdm_cstyle>";
print "<div id=\"POSTNOTE-{$id}\">";
if ($line['note']) {
print format_article_note($id, $line['note']);
}
print "</div>";
print sanitize_rss($link, $line["content_preview"]);
$article_content = $line["content_preview"];
$e_result = db_query($link, "SELECT * FROM ttrss_enclosures WHERE\n\t\t\t\t\t\tpost_id = '{$id}' AND content_url != ''");
if (db_num_rows($e_result) > 0) {
$entries_html = array();
$entries = array();
while ($e_line = db_fetch_assoc($e_result)) {
$url = $e_line["content_url"];
$ctype = $e_line["content_type"];
if (!$ctype) {
$ctype = __("unknown type");
}
$filename = substr($url, strrpos($url, "/") + 1);
$entry = format_inline_player($link, $url, $ctype);
$entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\">" . $filename . " (" . $ctype . ")" . "</a>";
array_push($entries_html, $entry);
$entry = array();
$entry["type"] = $ctype;
$entry["filename"] = $filename;
$entry["url"] = $url;
array_push($entries, $entry);
}
$tmp_result = db_query($link, "SELECT always_display_enclosures FROM\n\t\t\t\t\tttrss_feeds WHERE id = " . $line['feed_id'] . " AND owner_uid = " . $_SESSION["uid"]);
$always_display_enclosures = db_fetch_result($tmp_result, 0, "always_display_enclosures");
if (!get_pref($link, "STRIP_IMAGES")) {
if ($always_display_enclosures || !preg_match("/img/i", $article_content)) {
foreach ($entries as $entry) {
if (preg_match("/image/", $entry["type"]) || preg_match("/\\.(jpg|png|gif|bmp)/i", $entry["filename"])) {
print "<p><img \n\t\t\t\t\t\t\t\t\talt=\"" . htmlspecialchars($entry["filename"]) . "\"\n\t\t\t\t\t\t\t\t\tsrc=\"" . htmlspecialchars($entry["url"]) . "\"></p>";
}
开发者ID:wangroot,项目名称:Tiny-Tiny-RSS,代码行数:67,代码来源:functions.php
示例6: format_article
//.........这里部分代码省略.........
}
$result = db_query("SELECT id,title,link,content,feed_id,comments,int_id,\n\t\t\t" . SUBSTRING_FOR_DATE . "(updated,1,16) as updated,\n\t\t\t(SELECT site_url FROM ttrss_feeds WHERE id = feed_id) as site_url,\n\t\t\t(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) as hide_images,\n\t\t\t(SELECT always_display_enclosures FROM ttrss_feeds WHERE id = feed_id) as always_display_enclosures,\n\t\t\tnum_comments,\n\t\t\ttag_cache,\n\t\t\tauthor,\n\t\t\torig_feed_id,\n\t\t\tnote\n\t\t\tFROM ttrss_entries,ttrss_user_entries\n\t\t\tWHERE\tid = '{$id}' AND ref_id = id AND owner_uid = {$owner_uid}");
if ($result) {
$line = db_fetch_assoc($result);
$tag_cache = $line["tag_cache"];
$line["tags"] = get_article_tags($id, $owner_uid, $line["tag_cache"]);
unset($line["tag_cache"]);
$line["content"] = sanitize($line["content"], sql_bool_to_bool($line['hide_images']), $owner_uid, $line["site_url"]);
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE) as $p) {
$line = $p->hook_render_article($line);
}
$num_comments = $line["num_comments"];
$entry_comments = "";
if ($num_comments > 0) {
if ($line["comments"]) {
$comments_url = htmlspecialchars($line["comments"]);
} else {
$comments_url = htmlspecialchars($line["link"]);
}
$entry_comments = "<a target='_blank' href=\"{$comments_url}\">{$num_comments} comments</a>";
} else {
if ($line["comments"] && $line["link"] != $line["comments"]) {
$entry_comments = "<a target='_blank' href=\"" . htmlspecialchars($line["comments"]) . "\">comments</a>";
}
}
if ($zoom_mode) {
header("Content-Type: text/html");
$rv['content'] .= "<html><head>\n\t\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/>\n\t\t\t\t\t\t<title>Tiny Tiny RSS - " . $line["title"] . "</title>\n\t\t\t\t\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/tt-rss.css\">\n\t\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tfunction openSelectedAttachment(elem) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tvar url = elem[elem.selectedIndex].value;\n\n\t\t\t\t\t\t\t\tif (url) {\n\t\t\t\t\t\t\t\t\twindow.open(url);\n\t\t\t\t\t\t\t\t\telem.selectedIndex = 0;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\t\texception_error(\"openSelectedAttachment\", e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t</script>\n\t\t\t\t\t</head><body id=\"ttrssZoom\">";
}
$rv['content'] .= "<div class=\"postReply\" id=\"POST-{$id}\">";
$rv['content'] .= "<div class=\"postHeader\" id=\"POSTHDR-{$id}\">";
$entry_author = $line["author"];
if ($entry_author) {
$entry_author = __(" - ") . $entry_author;
}
$parsed_updated = make_local_datetime($line["updated"], true, $owner_uid, true);
$rv['content'] .= "<div class=\"postDate\">{$parsed_updated}</div>";
if ($line["link"]) {
$rv['content'] .= "<div class='postTitle'><a target='_blank'\n\t\t\t\t\ttitle=\"" . htmlspecialchars($line['title']) . "\"\n\t\t\t\t\thref=\"" . htmlspecialchars($line["link"]) . "\">" . $line["title"] . "</a>" . "<span class='author'>{$entry_author}</span></div>";
} else {
$rv['content'] .= "<div class='postTitle'>" . $line["title"] . "{$entry_author}</div>";
}
$tags_str = format_tags_string($line["tags"], $id);
$tags_str_full = join(", ", $line["tags"]);
if (!$tags_str_full) {
$tags_str_full = __("no tags");
}
if (!$entry_comments) {
$entry_comments = " ";
}
# placeholder
$rv['content'] .= "<div class='postTags' style='float : right'>\n\t\t\t\t<img src='images/tag.png'\n\t\t\t\tclass='tagsPic' alt='Tags' title='Tags'> ";
if (!$zoom_mode) {
$rv['content'] .= "<span id=\"ATSTR-{$id}\">{$tags_str}</span>\n\t\t\t\t\t<a title=\"" . __('Edit tags for this article') . "\"\n\t\t\t\t\thref=\"#\" onclick=\"editArticleTags({$id}, {$feed_id})\">(+)</a>";
$rv['content'] .= "<div dojoType=\"dijit.Tooltip\"\n\t\t\t\t\tid=\"ATSTRTIP-{$id}\" connectId=\"ATSTR-{$id}\"\n\t\t\t\t\tposition=\"below\">{$tags_str_full}</div>";
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_BUTTON) as $p) {
$rv['content'] .= $p->hook_article_button($line);
}
} else {
$tags_str = strip_tags($tags_str);
$rv['content'] .= "<span id=\"ATSTR-{$id}\">{$tags_str}</span>";
}
$rv['content'] .= "</div>";
$rv['content'] .= "<div clear='both'>";
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) {
$rv['content'] .= $p->hook_article_left_button($line);
}
$rv['content'] .= "{$entry_comments}</div>";
if ($line["orig_feed_id"]) {
$tmp_result = db_query("SELECT * FROM ttrss_archived_feeds\n\t\t\t\t\tWHERE id = " . $line["orig_feed_id"]);
if (db_num_rows($tmp_result) != 0) {
$rv['content'] .= "<div clear='both'>";
$rv['content'] .= __("Originally from:");
$rv['content'] .= " ";
$tmp_line = db_fetch_assoc($tmp_result);
$rv['content'] .= "<a target='_blank'\n\t\t\t\t\t\thref=' " . htmlspecialchars($tmp_line['site_url']) . "'>" . $tmp_line['title'] . "</a>";
$rv['content'] .= " ";
$rv['content'] .= "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
$rv['content'] .= "<img title='" . __('Feed URL') . "'class='tinyFeedIcon' src='images/pub_set.svg'></a>";
$rv['content'] .= "</div>";
}
}
$rv['content'] .= "</div>";
$rv['content'] .= "<div id=\"POSTNOTE-{$id}\">";
if ($line['note']) {
$rv['content'] .= format_article_note($id, $line['note'], !$zoom_mode);
}
$rv['content'] .= "</div>";
$rv['content'] .= "<div class=\"postContent\">";
$rv['content'] .= $line["content"];
$rv['content'] .= format_article_enclosures($id, sql_bool_to_bool($line["always_display_enclosures"]), $line["content"], sql_bool_to_bool($line["hide_images"]));
$rv['content'] .= "</div>";
$rv['content'] .= "</div>";
}
if ($zoom_mode) {
$rv['content'] .= "\n\t\t\t\t<div class='footer'>\n\t\t\t\t<button onclick=\"return window.close()\">" . __("Close this window") . "</button></div>";
$rv['content'] .= "</body></html>";
}
return $rv;
}
开发者ID:cs-team,项目名称:tiny_tiny_rss-openshift-quickstart,代码行数:101,代码来源:functions.php
注:本文中的format_article_note函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论