- $result_guests = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='N'", __FILE__, __LINE__);
- $result_members = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='N' AND is_member='Y'", __FILE__, __LINE__);
- $result_admins = SQL_QUERY("SELECT id FROM `{!MYSQL_PREFIX!}_online` WHERE is_admin='Y'", __FILE__, __LINE__);
-
- // Remember values for the template
- define('_GUESTS_ONLINE' , SQL_NUMROWS($result_guests));
- define('_ADMINS_ONLINE' , SQL_NUMROWS($result_admins));
- define('_MEMBERS_ONLINE', SQL_NUMROWS($result_members));
-
- // Free memory
- SQL_FREERESULT($result_guests);
- SQL_FREERESULT($result_admins);
- SQL_FREERESULT($result_members);
+ // @TODO Add a filter for sponsor
+ $content['guests_online'] = countSumTotalData('N', 'online', 'id', 'is_admin', true, " AND `is_member`='N'");
+ $content['admins_online'] = countSumTotalData('N', 'online', 'id', 'is_admin', true, " AND `is_member`='Y'");
+ $content['members_online'] = countSumTotalData('N', 'online', 'id', 'is_admin', true);