public static function init() { self::$userDetails = CWebUser::$data; self::$profiles = array(); $profilesTableSchema = DB::getSchema('profiles'); self::$stringProfileMaxLength = $profilesTableSchema['fields']['value_str']['length']; $db_profiles = DBselect('SELECT p.*' . ' FROM profiles p' . ' WHERE p.userid=' . self::$userDetails['userid'] . andDbNode('p.profileid', false) . ' ORDER BY p.userid,p.profileid'); while ($profile = DBfetch($db_profiles)) { $value_type = self::getFieldByType($profile['type']); if (!isset(self::$profiles[$profile['idx']])) { self::$profiles[$profile['idx']] = array(); } self::$profiles[$profile['idx']][$profile['idx2']] = $profile[$value_type]; } }