if ($label_cache) {\r
if ($label_cache["no-labels"] == 1)\r
$labels = array();\r
- else {\r
+ else\r
$labels = $label_cache;\r
- if (count($labels) > 0) {\r
- $bg = rgb2hsl(_color_unpack($labels[0][3]));\r
- if ($bg && $bg[1] > 0) {\r
+ }\r
+ }\r
\r
- $bg[1] = 0.1;\r
- $bg[2] = 1;\r
+ if (!is_array($labels)) $labels = get_article_labels($this->link, $id);\r
\r
- $bg = _color_pack(hsl2rgb($bg));\r
- $label_row_style = $this->make_gradient($bg, $class);;\r
- }\r
- }\r
+ if (count($labels) > 0) {\r
+ for ($i = 0; $i < min(4, count($labels)); $i++) {\r
+ $bg = rgb2hsl(_color_unpack($labels[$i][3]));\r
+\r
+ if ($bg && $bg[1] > 0) {\r
+ $bg[1] = 0.1;\r
+ $bg[2] = 1;\r
+\r
+ $bg = _color_pack(hsl2rgb($bg));\r
+ $label_row_style = $this->make_gradient($bg, $class);;\r
+\r
+ break;\r
}\r
}\r
}\r
\r
- if (!is_array($labels)) $labels = get_article_labels($this->link, $id);\r
-\r
$labels_str = "<span id=\"HLLCTR-$id\">";\r
$labels_str .= format_article_labels($labels, $id);\r
$labels_str .= "</span>";\r