diff options
| author | Joas Schilling <nickvergessen@gmx.de> | 2014-02-06 16:32:25 +0100 |
|---|---|---|
| committer | Joas Schilling <nickvergessen@gmx.de> | 2014-02-10 15:58:55 +0100 |
| commit | 3c46aeb0055d88919e1438941c34b97445a17878 (patch) | |
| tree | 98eea3bd9c5122726ab056c485c6d18743134ac2 /phpBB/phpbb | |
| parent | 6bee91c42915dd613e9714016006b25fa51cb24a (diff) | |
| download | forums-3c46aeb0055d88919e1438941c34b97445a17878.tar forums-3c46aeb0055d88919e1438941c34b97445a17878.tar.gz forums-3c46aeb0055d88919e1438941c34b97445a17878.tar.bz2 forums-3c46aeb0055d88919e1438941c34b97445a17878.tar.xz forums-3c46aeb0055d88919e1438941c34b97445a17878.zip | |
[ticket/12169] Allow displaying profile fields on memberlist
We can not sort by profile field values atm. And also I'm not sure
whether this is possible at all.
PHPBB3-12169
Diffstat (limited to 'phpBB/phpbb')
| -rw-r--r-- | phpBB/phpbb/profilefields/manager.php | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/phpBB/phpbb/profilefields/manager.php b/phpBB/phpbb/profilefields/manager.php index ead978374c..3948f32e93 100644 --- a/phpBB/phpbb/profilefields/manager.php +++ b/phpBB/phpbb/profilefields/manager.php @@ -246,9 +246,35 @@ class manager * Assign fields to template, used for viewprofile, viewtopic and memberlist (if load setting is enabled) * This is directly connected to the user -> mode == grab is to grab the user specific fields, mode == show is for assigning the row to the template */ - public function generate_profile_fields_template($mode, $user_id = 0, $profile_row = false) + public function generate_profile_fields_template($mode, $user_id = 0, $profile_row = false, $restrict_option = false) { - if ($mode == 'grab') + if ($mode == 'headlines') + { + if (!sizeof($this->profile_cache)) + { + $this->build_cache(); + } + + // Go through the fields in correct order + foreach ($this->profile_cache as $field_ident => $field_data) + { + if ($restrict_option && !$field_data[$restrict_option]) + { + continue; + } + + $profile_field = $this->type_collection[$field_data['field_type']]; + + $tpl_fields[] = array( + 'PROFILE_FIELD_TYPE' => $field_data['field_type'], + 'PROFILE_FIELD_NAME' => $profile_field->get_field_name($field_data['lang_name']), + 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($field_data['lang_explain']), + ); + } + + return $tpl_fields; + } + else if ($mode == 'grab') { if (!is_array($user_id)) { |
