user_id); $notifications_obj = $notifications->query_read(); if (count($notifications_obj) < 1) { $messages_tab_html = parse_template('partials/alert', ['type' => 'info', 'strong' => 'Notice', 'text' => 'No notifications.', '10px']); } else { $sql->modify('mark_read', " UPDATE mangadex_notifications SET is_read = 1 WHERE mentionee_user_id = ? ", [$user->user_id]); $memcached->delete("user_{$user->user_id}_unread_notifications"); $templateVars = [ 'notifications' => $notifications_obj ]; $messages_tab_html = parse_template('user/partials/messages_notifications', $templateVars); } break; case 'send': $messages_tab_html = parse_template('user/partials/messages_send', [ 'is_staff' => validate_level($user, 'pr') ]); break; case 'inbox': case 'bin': default: $deleted = ($mode == 'bin') ? 1 : 0; $current_page = (isset($_GET['p']) && $_GET['p'] > 0) ? $_GET['p'] : 1; $limit = 100; $threads = new PM_Threads($user->user_id, $deleted); $threads_obj = $threads->query_read($current_page, $limit); if ($threads->num_rows < 1) { $messages_tab_html = parse_template('partials/alert', ['type' => 'info', 'strong' => 'Notice', 'text' => 'There are no messages.']); } else { $templateVars = [ 'thread_count' => $threads->num_rows, 'current_page' => $current_page, 'mode' => $mode, 'limit' => $limit, 'threads' => $threads_obj, 'user' => $user, 'deleted' => $deleted, ]; $messages_tab_html = parse_template('user/partials/messages_list', $templateVars); } break; } $templateVars = [ 'mode' => $mode, 'messages_tab_html' => $messages_tab_html, ]; $page_html = parse_template('user/messages', $templateVars);