- $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 Rewrite these constants
+ // @TODO Add a filter for sponsor
+ define('_GUESTS_ONLINE' , GET_TOTAL_DATA('N', 'online', 'id', 'is_admin', true, " AND `is_member`='N'"));
+ define('_ADMINS_ONLINE' , GET_TOTAL_DATA('N', 'online', 'id', 'is_admin', true, " AND `is_member`='Y'"));
+ define('_MEMBERS_ONLINE', GET_TOTAL_DATA('N', 'online', 'id', 'is_admin', true));