/** * Parse/format the online list data for the records * * @author Brandon Farber * @param array Online list rows to check against * @return array Online list rows parsed */ public function parseOnlineEntries($rows) { if (!is_array($rows) or !count($rows)) { return $rows; } $final = array(); $profiles = array(); $members = array(); //----------------------------------------- // Extract the topic/forum data //----------------------------------------- foreach ($rows as $row) { if ($row['current_appcomponent'] != 'members' or !$row['current_module']) { continue; } if ($row['current_module'] == 'profile') { $profiles[] = $row['location_1_id']; } } if (count($profiles)) { ipsRegistry::DB()->build(array('select' => 'member_id, members_display_name, members_seo_name, member_banned, members_bitoptions', 'from' => 'members', 'where' => 'member_id IN(' . implode(',', $profiles) . ')')); $pr = ipsRegistry::DB()->execute(); while ($r = ipsRegistry::DB()->fetch($pr)) { /* Setup bitwise option to check for banned/spammer members */ $r = IPSMember::buildBitWiseOptions($r); if (!IPSMember::isInactive($r) || ipsRegistry::member()->getProperty('g_is_supmod')) { $members[$r['member_id']] = array('members_display_name' => $r['members_display_name'], 'members_seo_name' => $r['members_seo_name']); } } } foreach ($rows as $row) { if ($row['current_appcomponent'] == 'members') { if ($row['current_module'] == 'online') { $row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_online']; } if ($row['current_module'] == 'list') { $row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_members']; } if ($row['current_module'] == 'messaging') { $row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_msg']; } if ($row['current_module'] == 'profile') { if (isset($members[$row['location_1_id']])) { $row['where_line'] = ipsRegistry::getClass('class_localization')->words['WHERE_profile']; $row['where_line_more'] = $members[$row['location_1_id']]['members_display_name']; $row['where_link'] = 'showuser='******'location_1_id']; $row['_whereLinkSeo'] = ipsRegistry::getClass('output')->buildSEOUrl($row['where_link'], 'public', $members[$row['location_1_id']]['members_seo_name'], 'showuser'); } } } $final[$row['id']] = $row; } return $final; }