select('notes', 'noteid', ['ownerid' => $_SESSION['uid'], 'ORDER' => ['favorite' => "DESC"]]); $notes = []; foreach ($noteids as $n) { $notes[] = Note::loadNote($n); } // Check note quota $notequota = $SETTINGS['note_limit']; $notequotaset = $SETTINGS['note_limit'] !== false; $notequotareached = false; $usernotecount = 0; $userunlimited = false; if ($notequotaset) { $usernotecount = $database->count("notes", ['ownerid' => $_SESSION['uid']]); $usernotelimit = $SETTINGS['note_limit']; if ((new User($_SESSION['uid']))->hasPermission($SETTINGS['unlimited_permission'])) { $userunlimited = true; } if (!$userunlimited && $usernotecount >= $usernotelimit) { $notequotareached = true; } } ?>