]> git.wh0rd.org Git - tt-rss.git/commitdiff
only enable colored favicons in vfeeds; fix RGB triplet packing
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 15 Apr 2013 11:17:12 +0000 (15:17 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Mon, 15 Apr 2013 11:17:12 +0000 (15:17 +0400)
classes/feeds.php
include/functions.php
include/rssfuncs.php

index 64d1d8786e090a74bd18969f17b67eef93327d18..22c3497d467120449f9fbca7157b3c6b2186539d 100644 (file)
@@ -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\"
index 46882c3878165c363678d93f823b902d80d8e739..6372db1fd8e95d5d8dadb85879f2f10f47c99b34 100644 (file)
                                                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,
index bcc88dc2a8a6f54ff1216dacc4114847ed2c5ef4..2e522175ecffd3e9ce0b08f804d1de93481103f0 100644 (file)
 
                                                 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