MyBB Community Forums

Full Version: Remove guests from the "Who's Online" page /online.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Bump*

Does anyone know how I can Hide guests from showing in Who's Online? Version 1.8.22
diff --git a/online.php b/online.php
index f54f8cb26..9b5dd690c 100644
--- a/online.php
+++ b/online.php
@@ -158,7 +158,7 @@ else
                SELECT COUNT(*) AS online FROM (
                        SELECT 1
                        FROM " . TABLE_PREFIX . "sessions
-                       WHERE time > $timesearch
+                       WHERE time > $timesearch AND uid != 0
                        GROUP BY uid, ip
                ) s
        ");
@@ -220,7 +220,7 @@ else
                                        LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid = u.uid)
                                WHERE s.time > $timesearch
                        ) s
-                       WHERE row_num = 1
+                       WHERE row_num = 1 AND s.uid != 0
                        ORDER BY $sql
                        LIMIT {$start}, {$perpage}
                ");
@@ -242,6 +242,7 @@ else
                                        GROUP BY s2.uid, s2.ip
                                ) s2 ON (s.sid = s2.sid)
                                LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid = u.uid)
+                       WHERE s.uid != 0
                        ORDER BY $sql
                        LIMIT {$start}, {$perpage}
                ");
(2020-06-19, 01:37 PM)JordanMussi Wrote: [ -> ]
diff --git a/online.php b/online.php
index f54f8cb26..9b5dd690c 100644
--- a/online.php
+++ b/online.php
@@ -158,7 +158,7 @@ else
                SELECT COUNT(*) AS online FROM (
                        SELECT 1
                        FROM " . TABLE_PREFIX . "sessions
-                      WHERE time > $timesearch
+                      WHERE time > $timesearch AND uid != 0
                        GROUP BY uid, ip
                ) s
        ");
@@ -220,7 +220,7 @@ else
                                        LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid = u.uid)
                                WHERE s.time > $timesearch
                        ) s
-                      WHERE row_num = 1
+                      WHERE row_num = 1 AND s.uid != 0
                        ORDER BY $sql
                        LIMIT {$start}, {$perpage}
                ");
@@ -242,6 +242,7 @@ else
                                        GROUP BY s2.uid, s2.ip
                                ) s2 ON (s.sid = s2.sid)
                                LEFT JOIN ".TABLE_PREFIX."users u ON (s.uid = u.uid)
+                      WHERE s.uid != 0
                        ORDER BY $sql
                        LIMIT {$start}, {$perpage}
                ");

Thank you, so much! All good now Smile
Pages: 1 2