if (!empty($edited_User->reg_ctry_ID)) { // Get country that was defined by GeoIP Plugin on registration load_class('regional/model/_country.class.php', 'Country'); load_funcs('regional/model/_regional.funcs.php'); $CountryCache =& get_CountryCache(); $Country = $CountryCache->get_by_ID($edited_User->reg_ctry_ID); $from_country = country_flag($Country->get('code'), $Country->get_name(), 'w16px', 'flag', '', false, true, 'margin-bottom:3px;vertical-align:middle;') . ' ' . $Country->get_name(); } // Get field suffix for a field 'From Country' from the Plugins $user_from_country_suffix = ''; $Plugins->restart(); while ($loop_Plugin =& $Plugins->get_next()) { $user_from_country_suffix .= $loop_Plugin->GetUserFromCountrySuffix($tmp_params = array('User' => &$edited_User)); } $Form->begin_fieldset(T_('Registration info') . get_manual_link('user-admin-registration')); $Form->info_field(T_('Account registered on'), $edited_User->dget('datecreated'), array('note' => '(' . date_ago(strtotime($edited_User->get('datecreated'))) . ')')); $Form->info_field(T_('From IP'), format_to_output(int2ip($UserSettings->get('created_fromIPv4', $edited_User->ID)))); // Get status and name of IP range $IPRangeCache =& get_IPRangeCache(); if ($IPRange =& $IPRangeCache->get_by_ip(int2ip($UserSettings->get('created_fromIPv4', $edited_User->ID)))) { // IP range exists in DB $iprange_status = $IPRange->get('status'); $iprange_name = $IPRange->get_name(); } else { // There is no IP range in DB $iprange_status = ''; $iprange_name = ''; } $Form->info_field(T_('IP range'), $iprange_name); $email_status_icon = '<div id="iprange_status_icon">' . aipr_status_icon($iprange_status) . '</div>'; $Form->select_input_array('edited_iprange_status', $iprange_status, aipr_status_titles(true), T_('IP range status'), '', array('force_keys_as_values' => true, 'background_color' => aipr_status_colors(), 'field_suffix' => $email_status_icon));
public function ago($date) { return date_ago(Date::createFromFormat('Y-m-d', $date)); }