summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-15 15:17:12 +0400
committerAndrew Dolgov <[email protected]>2013-04-15 15:17:12 +0400
commit63c323f73610d81216801d1023dca724cfd32699 (patch)
treec71d5093059b664268f8d778a3f61b41d1bd00cd
parent687a4f59c8d8be091b732ae6714fbdc140169d47 (diff)
only enable colored favicons in vfeeds; fix RGB triplet packing
-rw-r--r--classes/feeds.php4
-rw-r--r--include/functions.php3
-rw-r--r--include/rssfuncs.php10
3 files changed, 12 insertions, 5 deletions
diff --git a/classes/feeds.php b/classes/feeds.php
index 64d1d8786..22c3497d4 100644
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -529,8 +529,8 @@ class Feeds extends Handler_Protected {
id=\"RROW-$id\" $mouseover_attrs'>";
//setting feed headline background color, needs to change text color based on dark/light
- $favColor = explode("|", $line['favicon_avg_color']);
- $reply['content'] .= "<div class=\"cdmHeader\" style=\"background-color: rgb($favColor[0], $favColor[1], $favColor[2]);\">";
+ $fav_color = $line['favicon_avg_color'];
+ $reply['content'] .= "<div class=\"cdmHeader\" style=\"background-color: $fav_color;\">";
$reply['content'] .= "<div style=\"vertical-align : middle\">";
$reply['content'] .= "<input dojoType=\"dijit.form.CheckBox\"
diff --git a/include/functions.php b/include/functions.php
index 46882c387..6372db1fd 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -2602,6 +2602,9 @@
LEFT JOIN ttrss_feeds ON (feed_id = ttrss_feeds.id)";
}
+ if ($vfeed_query_part)
+ $vfeed_query_part .= "favicon_avg_color,";
+
$query = "SELECT DISTINCT
date_entered,
guid,
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index bcc88dc2a..2e522175e 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -416,9 +416,13 @@
require_once "colors.php";
- if (is_array($favicon_color))
- $favicon_colorstring = ",favicon_avg_color = '" .
- _color_pack(array_slice($favicon_color, 0, 3)) . "'";
+ if (is_array($favicon_color))
+ $tmp = array($favicon_color['red'],
+ $favicon_color['green'],
+ $favicon_color['blue']);
+
+ $favicon_colorstring = ",favicon_avg_color = '" .
+ _color_pack($tmp) . "'";
}
db_query($link, "UPDATE ttrss_feeds SET favicon_last_checked = NOW() $favicon_colorstring