]> git.wh0rd.org - tt-rss.git/blobdiff - classes/feeds.php
Merge branch 'master' into hookhead
[tt-rss.git] / classes / feeds.php
index aeadcf257e6623e559b8814db5d72a0676ad364c..ccc0548db07d12dc81fa159a7bdb422814cd15cd 100644 (file)
@@ -286,8 +286,12 @@ class Feeds extends Handler_Protected {
                        if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PS", $timing_info);
 
                        $expand_cdm = get_pref('CDM_EXPANDED');
-
+                               
                        while ($line = $this->dbh->fetch_assoc($result)) {
+                               $line["content_preview"] =  "— " . 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);
+                               }
                                $id = $line["id"];
                                $feed_id = $line["feed_id"];
                                $label_cache = $line["label_cache"];
@@ -360,9 +364,8 @@ 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 = " — " . truncate_string(strip_tags($line["content_preview"]),
-                                               250);
+                               if (get_pref('SHOW_CONTENT_PREVIEW') ) {
+                                               $content_preview =  $line["content_preview"];   
                                }
 
                                $score = $line["score"];
@@ -377,9 +380,9 @@ class Feeds extends Handler_Protected {
                                        title=\"$score\">";
 
                                if ($score > 500) {
-                                       $hlc_suffix = "H";
+                                       $hlc_suffix = "high";
                                } else if ($score < -100) {
-                                       $hlc_suffix = "L";
+                                       $hlc_suffix = "low";
                                } else {
                                        $hlc_suffix = "";
                                }
@@ -448,16 +451,14 @@ class Feeds extends Handler_Protected {
                                        $reply['content'] .= "</div>";
 
                                        $reply['content'] .= "<div onclick='return hlClicked(event, $id)'
-                                               class=\"hlTitle\"><span class='hlContent$hlc_suffix'>";
-                                       $reply['content'] .= "<a id=\"RTITLE-$id\" class=\"title\"
+                                               class=\"hlTitle\"><span class='hlContent $hlc_suffix'>";
+                                       $reply['content'] .= "<a id=\"RTITLE-$id\" class=\"title $hlc_suffix\"
                                                href=\"" . htmlspecialchars($line["link"]) . "\"
                                                onclick=\"\">" .
                                                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 +503,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) {
@@ -539,7 +540,7 @@ class Feeds extends Handler_Protected {
 
                                        $expanded_class = $expand_cdm ? "expanded" : "expandable";
 
-                                       $reply['content'] .= "<div class=\"cdm $expanded_class $class\"
+                                       $reply['content'] .= "<div class=\"cdm $hlc_suffix $expanded_class $class\"
                                                id=\"RROW-$id\" $mouseover_attrs>";
 
                                        $reply['content'] .= "<div class=\"cdmHeader\" style=\"$row_background\">";
@@ -556,8 +557,8 @@ class Feeds extends Handler_Protected {
 
                                        $reply['content'] .= "<span id=\"RTITLE-$id\"
                                                onclick=\"return cdmClicked(event, $id);\"
-                                               class=\"titleWrap$hlc_suffix\">
-                                               <a class=\"title\"
+                                               class=\"titleWrap $hlc_suffix\">
+                                               <a class=\"title $hlc_suffix\"
                                                target=\"_blank\" href=\"".
                                                htmlspecialchars($line["link"])."\">".
                                                $line["title"] .
@@ -574,8 +575,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')) {