From: Michael Date: Thu, 19 Jan 2017 10:00:44 +0000 (+0000) Subject: Added limit X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=75097ebf37df318dc95ad997664924c0c2be6462;p=friendica.git Added limit --- diff --git a/mod/network.php b/mod/network.php index 2f33c62f72..12223494a7 100644 --- a/mod/network.php +++ b/mod/network.php @@ -762,24 +762,25 @@ function network_content(App $a, $update = 0) { // on they just get buried deeper. It has happened to me a couple of times also. - if((! $group) && (! $cid) && (! $star)) { + if (!$group && !$cid && !$star) { - $unseen = q("SELECT `id` FROM `item` WHERE `unseen` AND `uid` = %d", + $unseen = q("SELECT `id` FROM `item` WHERE `unseen` AND `uid` = %d LIMIT 1", intval(local_user())); - if ($unseen) + if (dbm::is_result($unseen)) { $r = q("UPDATE `item` SET `unseen` = 0 WHERE `unseen` = 1 AND `uid` = %d", intval(local_user()) ); - } - else { - if($update_unseen) { + } + } else { + if ($update_unseen) { - $unseen = q("SELECT `id` FROM `item` ".$update_unseen); + $unseen = q("SELECT `id` FROM `item` ".$update_unseen. " LIMIT 1"); - if ($unseen) + if (dbm::is_result($unseen)) { $r = q("UPDATE `item` SET `unseen` = 0 $update_unseen"); + } } }