$always_display_enclosures = sql_bool_to_bool($line["always_display_enclosures"]);
- $reply['content'] .= format_article_enclosures($this->link, $id, $always_display_enclosures,
- $line["content"]);
+ $reply['content'] .= format_article_enclosures($this->link, $id, $always_display_enclosures, $line["content"], sql_bool_to_bool($line["hide_images"]));
$reply['content'] .= "</div>";
$result = db_query($link, "SELECT id,title,link,content,feed_id,comments,int_id,
".SUBSTRING_FOR_DATE."(updated,1,16) as updated,
(SELECT site_url FROM ttrss_feeds WHERE id = feed_id) as site_url,
+ (SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) as hide_images,
num_comments,
tag_cache,
author,
$rv['content'] .= $line["content"];
$rv['content'] .= format_article_enclosures($link, $id,
- $always_display_enclosures, $line["content"]);
+ $always_display_enclosures, $line["content"], $line["hide_images"]);
$rv['content'] .= "</div>";
}
function format_article_enclosures($link, $id, $always_display_enclosures,
- $article_content) {
+ $article_content, $hide_images = false) {
$result = get_article_enclosures($link, $id);
$rv = '';
if (preg_match("/image/", $entry["type"]) ||
preg_match("/\.(jpg|png|gif|bmp)/i", $entry["filename"])) {
- $rv .= "<p><img
- alt=\"".htmlspecialchars($entry["filename"])."\"
- src=\"" .htmlspecialchars($entry["url"]) . "\"/></p>";
+ if (!$hide_images) {
+ $rv .= "<p><img
+ alt=\"".htmlspecialchars($entry["filename"])."\"
+ src=\"" .htmlspecialchars($entry["url"]) . "\"/></p>";
+ } else {
+ $rv .= "<p><a target=\"_blank\"
+ href=\"".htmlspecialchars($entry["url"])."\"
+ >" .htmlspecialchars($entry["url"]) . "</a></p>";
+ }
}
}
}