diff --git a/daos/mysql/Items.php b/daos/mysql/Items.php index 8122dd8231..591862ffc0 100644 --- a/daos/mysql/Items.php +++ b/daos/mysql/Items.php @@ -133,7 +133,7 @@ public function add($values) { * @param string $uid */ public function exists($uid) { - $res = \F3::get('db')->exec('SELECT COUNT(*) AS amount FROM items WHERE uid=:uid', + $res = \F3::get('db')->exec('SELECT COUNT(1) AS amount FROM items WHERE uid=:uid', array(':uid' => $uid)); return $res[0]['amount']>0; } @@ -262,7 +262,7 @@ public function getIcons() { * @param string $thumbnail name */ public function hasThumbnail($thumbnail) { - $res = \F3::get('db')->exec('SELECT count(*) AS amount + $res = \F3::get('db')->exec('SELECT count(1) AS amount FROM items WHERE thumbnail=:thumbnail', array(':thumbnail' => $thumbnail)); @@ -280,7 +280,7 @@ public function hasThumbnail($thumbnail) { * @param string $icon file */ public function hasIcon($icon) { - $res = \F3::get('db')->exec('SELECT count(*) AS amount + $res = \F3::get('db')->exec('SELECT count(1) AS amount FROM items WHERE icon=:icon', array(':icon' => $icon)); @@ -342,8 +342,8 @@ public function getLastIcon($sourceid) { * @return int amount of entries in database */ public function numberOfItems() { - $res = \F3::get('db')->exec('SELECT count(*) AS amount FROM items'); - return $res[0]['amount']; + $res = \F3::get('db')->exec('SELECT count(1) AS amount FROM items'); + return $res[0]['amount']>0; } @@ -353,10 +353,10 @@ public function numberOfItems() { * @return int amount of entries in database which are unread */ public function numberOfUnread() { - $res = \F3::get('db')->exec('SELECT count(*) AS amount + $res = \F3::get('db')->exec('SELECT count(1) AS amount FROM items WHERE unread=1'); - return $res[0]['amount']; + return $res[0]['amount']>0; } @@ -366,10 +366,10 @@ public function numberOfUnread() { * @return int amount of entries in database which are starred */ public function numberOfStarred() { - $res = \F3::get('db')->exec('SELECT count(*) AS amount + $res = \F3::get('db')->exec('SELECT count(1) AS amount FROM items WHERE starred=1'); - return $res[0]['amount']; + return $res[0]['amount']>0; } @@ -379,7 +379,7 @@ public function numberOfStarred() { * @return int amount of entries in database per tag */ public function numberOfUnreadForTag($tag) { - $select = 'SELECT count(*) AS amount FROM items, sources'; + $select = 'SELECT count(1) AS amount FROM items, sources'; $where = ' WHERE items.source=sources.id AND unread=1'; if ( \F3::get( 'db_type' ) == 'mysql' ) { $where .= " AND ( CONCAT( ',' , sources.tags , ',' ) LIKE :tag ) "; @@ -398,7 +398,7 @@ public function numberOfUnreadForTag($tag) { */ public function numberOfUnreadForSource($sourceid) { $res = \F3::get('db')->exec( - 'SELECT count(*) AS amount FROM items WHERE source=:source AND unread=1', + 'SELECT count(1) AS amount FROM items WHERE source=:source AND unread=1', array(':source' => $sourceid)); return $res[0]['amount']; } diff --git a/public/css/style.css b/public/css/style.css index 2a9791f7ae..b15810f11f 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -89,8 +89,17 @@ input { } #nav-filter span { - font-size:0.55em; - color:#777; + background-color: #E74C3C; + border-radius: 30px; + color: white; + font-size: 10px; + font-weight: 500; + line-height: 16px; + min-width: 8px; + padding: 0 4px 0 5px; + margin-top: 6px; + position: absolute; + margin-left: 5px; } #nav h2 { @@ -146,6 +155,20 @@ input { vertical-align:sub; color: #777; } + + #nav-tags li span.unread { + background-color: #E74C3C; + border-radius: 30px; + color: white; + font-size: 10px; + font-weight: 500; + line-height: 16px; + min-width: 8px; + padding: 0 4px 0 5px; + margin-top: 6px; + position: absolute; + margin-left: 5px; + } #nav-sources-wrapper { overflow:hidden; @@ -348,6 +371,9 @@ input { .entry.selected.unread, .entry.unread { border-left:3px solid #5f9490; + border-bottom: 1px solid #5F9490; + border-right: 1px solid #5F9490; + border-top: 1px solid #5F9490; } .entry.selected {