From 54e61a6809a6f0e249ff12207b19b6ad3203089f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 6 Oct 2009 14:15:29 +0400 Subject: add option to force display attachments in feeds (implementation) --- functions.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index b67ff9570..effd20005 100644 --- a/functions.php +++ b/functions.php @@ -4568,13 +4568,15 @@ if (!$zoom_mode) { print "
"; - if (!preg_match("/"; - print sanitize_rss($link, $line["content_preview"]); - print "
"; if ($line['note']) { print format_article_note($id, $line['note']); } print "
"; + print sanitize_rss($link, $line["content_preview"]); + $article_content = $line["content_preview"]; $e_result = db_query($link, "SELECT * FROM ttrss_enclosures WHERE @@ -5310,7 +5312,12 @@ array_push($entries, $entry); } - if (!preg_match("/img/i", $article_content)) { + $tmp_result = db_query($link, "SELECT always_display_enclosures FROM + ttrss_feeds WHERE id = ".$line['feed_id']." AND owner_uid = ".$_SESSION["uid"]); + + $always_display_enclosures = db_fetch_result($tmp_result, 0, "always_display_enclosures"); + + if ($always_display_enclosures || !preg_match("/img/i", $article_content)) { foreach ($entries as $entry) { if (preg_match("/image/", $entry["type"])) { print "