$TMPL['avatar_url'] = $DB->escape($FORM['avatar_url']); $custom_fields_value .= ", avatar_url = '{$TMPL['avatar_url']}'"; // Normal banner if (!empty($TMPL['avatar_url'])) { list($old_avatar_url) = $DB->fetch("SELECT avatar_url FROM {$CONF['sql_prefix']}_sites WHERE username = '{$TMPL['username']}'", __FILE__, __LINE__); if ($TMPL['avatar_url'] != $old_avatar_url) { // Hosted on list url or external image? $local_image = stripos($TMPL['avatar_url'], $CONF['list_url']) === 0 ? true : false; if ($local_image === true) { // Replace list url with path $avatar_path = str_replace($CONF['list_url'], $CONF['path'], $TMPL['avatar_url']); // Check if file is still on filesystem if (file_exists($avatar_path)) { $avatar_size = getimagesize($avatar_path); if (!empty($avatar_size)) { $avatar_width = (int)$avatar_size[0]; $avatar_height = (int)$avatar_size[1]; $custom_fields_value .= ", avatar_width = {$avatar_width}, avatar_height = {$avatar_height}"; } } } else { // External file, mostly aardvark upgraders if (ini_get('allow_url_fopen')) { $avatar_size = @getimagesize($TMPL['avatar_url']); if (!empty($avatar_size)) { $avatar_width = (int)$avatar_size[0]; $avatar_height = (int)$avatar_size[1]; $custom_fields_value .= ", avatar_width = {$avatar_width}, avatar_height = {$avatar_height}"; } } } } }