From 5daa24f2333ee9f5a5c6188b2a655ae89c57d78c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 30 Apr 2008 11:39:05 +0100 Subject: [PATCH] CDM: implement scoring display --- functions.php | 59 ++++++++++++++++----------------------------------- tt-rss.css | 19 +++++++++++++++-- 2 files changed, 35 insertions(+), 43 deletions(-) diff --git a/functions.php b/functions.php index cda69bb7..180d021b 100644 --- a/functions.php +++ b/functions.php @@ -730,30 +730,7 @@ _debug("update_rss_feed: loading filters..."); } - $filters = array(); - - $result = db_query($link, "SELECT reg_exp, - ttrss_filter_types.name AS name, - ttrss_filter_actions.name AS action, - inverse, - action_param - FROM ttrss_filters,ttrss_filter_types,ttrss_filter_actions WHERE - enabled = true AND - owner_uid = $owner_uid AND - ttrss_filter_types.id = filter_type AND - ttrss_filter_actions.id = action_id AND - (feed_id IS NULL OR feed_id = '$feed') ORDER BY reg_exp"); - - while ($line = db_fetch_assoc($result)) { - if (!$filters[$line["name"]]) $filters[$line["name"]] = array(); - - $filter["reg_exp"] = $line["reg_exp"]; - $filter["action"] = $line["action"]; - $filter["action_param"] = $line["action_param"]; - $filter["inverse"] = sql_bool_to_bool($line["inverse"]); - - array_push($filters[$line["name"]], $filter); - } + $filters = load_filters($link, $feed, $owner_uid); if ($use_simplepie) { $iterator = $rss->get_items(); @@ -4945,9 +4922,17 @@ $score_title = __("(Click to change)"); - $score_pic = ""; + if ($score > 500) { + $hlc_suffix = "H"; + } else if ($score < -100) { + $hlc_suffix = "L"; + } else { + $hlc_suffix = ""; + } + $entry_author = $line["author"]; if ($entry_author) { @@ -4990,15 +4975,6 @@ # truncate_string($line["feed_title"],30)." "; # } else { - - if ($score > 500) { - $hlc_suffix = "H"; - } else if ($score < -100) { - $hlc_suffix = "L"; - } else { - $hlc_suffix = ""; - } - print ""; print "" . @@ -5054,7 +5030,7 @@ $expand_cdm = get_pref($link, 'CDM_EXPANDED'); - if ($expand_cdm) { + if ($expand_cdm && $score >= -100) { $cdm_cstyle = ""; } else { $cdm_cstyle = "style=\"display : none\""; @@ -5066,15 +5042,16 @@ print "
"; - print "
$updated_fmt
"; - - print "
$updated_fmt $score_pic
"; + + print "".$line["title"].""; + target=\"_blank\" href=\"".$line["link"]."\">".$line["title"]." + "; print $entry_author; - if (!$expand_cdm) { + if (!$expand_cdm || $score < -100) { print "  (".__('Show article').")"; @@ -5087,7 +5064,7 @@ } } - print ""; + print ""; if (get_pref($link, 'OPEN_LINKS_IN_NEW_WINDOW')) { $line["content_preview"] = preg_replace("/href=/i", diff --git a/tt-rss.css b/tt-rss.css index 65c93175..abed3456 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -925,7 +925,7 @@ div.cdmHeader { padding : 5px 5px 10px 5px; } -div.cdmArticleUnread div.cdmHeader a { +div.cdmArticleUnread div.cdmHeader span.titleWrap a { color : black; } @@ -995,7 +995,6 @@ div.cdmHeader a:hover { div.cdmContent { margin : 5px 15px 0px 15px; - } div.cdmEnclosures { @@ -1768,3 +1767,19 @@ td.hlContentL a, td.hlContentL span { color : #909090; text-decoration : line-through; } + +span.titleWrapH, span.titleWrapH a { + color : #00cc00; +} + +span.titleWrapL, span.titleWrapL a { + color : #909090; + text-decoration : line-through; +} + +img.hlScorePic { + vertical-align : middle; + width : 16px; + height : 16px; +} + -- 2.39.5