]> git.wh0rd.org - tt-rss.git/blobdiff - classes/feeds.php
Merge branch 'master' of github.com:gothfox/Tiny-Tiny-RSS
[tt-rss.git] / classes / feeds.php
index b15875bd31143357e852e98563a6452752b84209..c57328fe7e57ffdcb613aa87ceb67a2120158f1d 100644 (file)
@@ -61,7 +61,7 @@ class Feeds extends Handler_Protected {
                                truncate_string($feed_title,30)."</a>";
 
                        if ($error) {
-                               $reply .= " (<span class=\"error\" title=\"$error\">Error</span>)";
+                               $reply .= "&nbsp;<img title='$error' src='images/error.png' alt='error' class=\"noborder\" style=\"vertical-align : middle\">";
                        }
 
                } else {
@@ -74,7 +74,7 @@ class Feeds extends Handler_Protected {
                        <a href=\"#\"
                                title=\"".__("View as RSS feed")."\"
                                onclick=\"displayDlg('".__("View as RSS")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">
-                               <img class=\"noborder\" style=\"vertical-align : middle\" src=\"images/pub_set.svg\"></a>";
+                               <img class=\"noborder\" style=\"vertical-align : middle\" src=\"images/pub_set.png\"></a>";
 
                $reply .= "</span>";
 
@@ -288,6 +288,16 @@ class Feeds extends Handler_Protected {
                        $expand_cdm = get_pref('CDM_EXPANDED');
 
                        while ($line = $this->dbh->fetch_assoc($result)) {
+                               $line["content_preview"] =  "&mdash; " . truncate_string(strip_tags($line["content_preview"]), 250);
+
+                               foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {
+                                       $line = $p->hook_query_headlines($line, 250, false);
+                               }
+
+                               if (get_pref('SHOW_CONTENT_PREVIEW')) {
+                                       $content_preview =  $line["content_preview"];
+                               }
+
                                $id = $line["id"];
                                $feed_id = $line["feed_id"];
                                $label_cache = $line["label_cache"];
@@ -323,24 +333,24 @@ class Feeds extends Handler_Protected {
 
                                if (sql_bool_to_bool($line["marked"])) {
                                        $marked_pic = "<img
-                                               src=\"images/mark_set.svg\"
+                                               src=\"images/mark_set.png\"
                                                class=\"markedPic\" alt=\"Unstar article\"
                                                onclick='toggleMark($id)'>";
                                        $class .= " marked";
                                } else {
                                        $marked_pic = "<img
-                                               src=\"images/mark_unset.svg\"
+                                               src=\"images/mark_unset.png\"
                                                class=\"markedPic\" alt=\"Star article\"
                                                onclick='toggleMark($id)'>";
                                }
 
                                if (sql_bool_to_bool($line["published"])) {
-                                       $published_pic = "<img src=\"images/pub_set.svg\"
+                                       $published_pic = "<img src=\"images/pub_set.png\"
                                                class=\"pubPic\"
                                                        alt=\"Unpublish article\" onclick='togglePub($id)'>";
                                        $class .= " published";
                                } else {
-                                       $published_pic = "<img src=\"images/pub_unset.svg\"
+                                       $published_pic = "<img src=\"images/pub_unset.png\"
                                                class=\"pubPic\"
                                                alt=\"Publish article\" onclick='togglePub($id)'>";
                                }
@@ -360,11 +370,6 @@ class Feeds extends Handler_Protected {
                                $date_entered_fmt = T_sprintf("Imported at %s",
                                        make_local_datetime($line["date_entered"], false));
 
-                               if (get_pref('SHOW_CONTENT_PREVIEW')) {
-                                       $content_preview = " &mdash; " . truncate_string(strip_tags($line["content_preview"]),
-                                               250);
-                               }
-
                                $score = $line["score"];
 
                                $score_pic = "images/" . get_score_pic($score);
@@ -395,7 +400,7 @@ class Feeds extends Handler_Protected {
                                if ($has_feed_icon) {
                                        $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"".ICONS_URL."/$feed_id.ico\" alt=\"\">";
                                } else {
-                                       $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"images/pub_set.svg\" alt=\"\">";
+                                       $feed_icon_img = "<img class=\"tinyFeedIcon\" src=\"images/pub_set.png\" alt=\"\">";
                                }
 
                                $entry_site_url = $line["site_url"];
@@ -455,9 +460,7 @@ class Feeds extends Handler_Protected {
                                                truncate_string($line["title"], 200);
 
                                        if (get_pref('SHOW_CONTENT_PREVIEW')) {
-                                               if ($content_preview) {
-                                                       $reply['content'] .= "<span class=\"contentPreview\">$content_preview</span>";
-                                               }
+                                                       $reply['content'] .= "<span class=\"contentPreview\">" . $line["content_preview"] . "</span>";
                                        }
 
                                        $reply['content'] .= "</a></span>";
@@ -502,7 +505,7 @@ class Feeds extends Handler_Protected {
                                        else
                                                $tags = false;
 
-                                       $line["content"] = sanitize($line["content_preview"],
+                                       $line["content"] = sanitize($line["content"],
                                                        sql_bool_to_bool($line['hide_images']), false, $entry_site_url);
 
                                        foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_CDM) as $p) {
@@ -574,8 +577,8 @@ class Feeds extends Handler_Protected {
                                        else
                                                $excerpt_hidden = "style=\"display : none\"";
 
-                                       $reply['content'] .= "<span $excerpt_hidden
-                                               id=\"CEXC-$id\" class=\"cdmExcerpt\">$content_preview</span>";
+                                       $reply['content'] .= "<span $excerpt_hidden id=\"CEXC-$id\" class=\"cdmExcerpt\">" . $line["content_preview"] . "</span>";
+
                                        $reply['content'] .= "</span>";
 
                                        if (!get_pref('VFEED_GROUP_BY_FEED')) {
@@ -638,7 +641,7 @@ class Feeds extends Handler_Protected {
                                                        $reply['content'] .= "&nbsp;";
 
                                                        $reply['content'] .= "<a target='_blank' href='" . htmlspecialchars($tmp_line['feed_url']) . "'>";
-                                                       $reply['content'] .= "<img title='".__('Feed URL')."'class='tinyFeedIcon' src='images/pub_unset.svg'></a>";
+                                                       $reply['content'] .= "<img title='".__('Feed URL')."'class='tinyFeedIcon' src='images/pub_unset.png'></a>";
 
                                                        $reply['content'] .= "</div>";
                                                }