summaryrefslogtreecommitdiff
path: root/includes/pages/user_messages.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/pages/user_messages.php')
-rw-r--r--includes/pages/user_messages.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/pages/user_messages.php b/includes/pages/user_messages.php
index 0738f433..d2034dc0 100644
--- a/includes/pages/user_messages.php
+++ b/includes/pages/user_messages.php
@@ -15,12 +15,12 @@ function messages_title()
*/
function user_unread_messages()
{
- global $user;
+ $user = Auth()->user();
- if (isset($user)) {
+ if ($user) {
$new_messages = count(DB::select(
'SELECT `id` FROM `Messages` WHERE isRead=\'N\' AND `RUID`=?',
- [$user['UID']]
+ [$user->id]
));
if ($new_messages > 0) {
return ' <span class="badge danger">' . $new_messages . '</span>';