diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index 09a42bc684..da84a6029e 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -1408,6 +1408,7 @@ function get_schema_struct()
'field_validation' => array('VCHAR_UNI:20', ''),
'field_required' => array('BOOL', 0),
'field_show_on_reg' => array('BOOL', 0),
+ 'field_show_on_vt' => array('BOOL', 0),
'field_show_profile' => array('BOOL', 0),
'field_hide' => array('BOOL', 0),
'field_no_view' => array('BOOL', 0),
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 1d83a27174..875dbf1400 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -258,9 +258,9 @@
[Feature] Display version check on ACP main page.
[Feature] Ability to copy permissions from one forum to several other forums.
+ [Feature] Ability to control the display of custom profile fields on viewtopic (Bug #48985).
[Feature] Fallback options for missing language files. (Bug #38575 - Patch by EXreaction)
-
1.ii. Changes since 3.0.4
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index bbe36af9be..1b0ec4b5d5 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -369,6 +369,7 @@ class acp_profile
'field_show_profile'=> 0,
'field_no_view' => 0,
'field_show_on_reg' => 0,
+ 'field_show_on_vt' => 0,
'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)),
'lang_explain' => '',
'lang_default_value'=> '')
@@ -379,7 +380,7 @@ class acp_profile
// $exclude contains the data we gather in each step
$exclude = array(
- 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),
+ 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),
2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
);
@@ -405,6 +406,7 @@ class acp_profile
$visibility_ary = array(
'field_required',
'field_show_on_reg',
+ 'field_show_on_vt',
'field_show_profile',
'field_hide',
);
@@ -721,6 +723,7 @@ class acp_profile
'S_STEP_ONE' => true,
'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false,
'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false,
+ 'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false,
'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false,
'S_SHOW_PROFILE' => ($cp->vars['field_show_profile']) ? true : false,
'S_FIELD_NO_VIEW' => ($cp->vars['field_no_view']) ? true : false,
@@ -1036,6 +1039,7 @@ class acp_profile
'field_validation' => $cp->vars['field_validation'],
'field_required' => $cp->vars['field_required'],
'field_show_on_reg' => $cp->vars['field_show_on_reg'],
+ 'field_show_on_vt' => $cp->vars['field_show_on_vt'],
'field_hide' => $cp->vars['field_hide'],
'field_show_profile' => $cp->vars['field_show_profile'],
'field_no_view' => $cp->vars['field_no_view']
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 709836ea88..e692750659 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -704,6 +704,9 @@ function database_update_info()
REPORTS_TABLE => array(
'pm_id' => array('UINT', 0),
),
+ PROFILE_FIELDS_TABLE => array(
+ 'field_show_on_vt' => array('BOOL', 0),
+ ),
),
'change_columns' => array(
USERS_TABLE => array(
diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql
index de1472f6fd..a059dd6e2b 100644
--- a/phpBB/install/schemas/firebird_schema.sql
+++ b/phpBB/install/schemas/firebird_schema.sql
@@ -790,6 +790,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
field_required INTEGER DEFAULT 0 NOT NULL,
field_show_on_reg INTEGER DEFAULT 0 NOT NULL,
+ field_show_on_vt INTEGER DEFAULT 0 NOT NULL,
field_show_profile INTEGER DEFAULT 0 NOT NULL,
field_hide INTEGER DEFAULT 0 NOT NULL,
field_no_view INTEGER DEFAULT 0 NOT NULL,
@@ -1370,7 +1371,9 @@ CREATE TABLE phpbb_users (
user_actkey VARCHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL,
user_newpasswd VARCHAR(40) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
user_form_salt VARCHAR(32) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE,
- user_new INTEGER DEFAULT 1 NOT NULL
+ user_new INTEGER DEFAULT 1 NOT NULL,
+ user_reminded INTEGER DEFAULT 0 NOT NULL,
+ user_reminded_time INTEGER DEFAULT 0 NOT NULL
);;
ALTER TABLE phpbb_users ADD PRIMARY KEY (user_id);;
diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql
index 612b2b8d76..b6f85c907e 100644
--- a/phpBB/install/schemas/mssql_schema.sql
+++ b/phpBB/install/schemas/mssql_schema.sql
@@ -948,6 +948,7 @@ CREATE TABLE [phpbb_profile_fields] (
[field_validation] [varchar] (20) DEFAULT ('') NOT NULL ,
[field_required] [int] DEFAULT (0) NOT NULL ,
[field_show_on_reg] [int] DEFAULT (0) NOT NULL ,
+ [field_show_on_vt] [int] DEFAULT (0) NOT NULL ,
[field_show_profile] [int] DEFAULT (0) NOT NULL ,
[field_hide] [int] DEFAULT (0) NOT NULL ,
[field_no_view] [int] DEFAULT (0) NOT NULL ,
@@ -1645,7 +1646,9 @@ CREATE TABLE [phpbb_users] (
[user_actkey] [varchar] (32) DEFAULT ('') NOT NULL ,
[user_newpasswd] [varchar] (40) DEFAULT ('') NOT NULL ,
[user_form_salt] [varchar] (32) DEFAULT ('') NOT NULL ,
- [user_new] [int] DEFAULT (1) NOT NULL
+ [user_new] [int] DEFAULT (1) NOT NULL ,
+ [user_reminded] [int] DEFAULT (0) NOT NULL ,
+ [user_reminded_time] [int] DEFAULT (0) NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql
index 5934d2d173..7b506f5a75 100644
--- a/phpBB/install/schemas/mysql_40_schema.sql
+++ b/phpBB/install/schemas/mysql_40_schema.sql
@@ -554,6 +554,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation varbinary(60) DEFAULT '' NOT NULL,
field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
@@ -971,6 +972,8 @@ CREATE TABLE phpbb_users (
user_newpasswd varbinary(120) DEFAULT '' NOT NULL,
user_form_salt varbinary(96) DEFAULT '' NOT NULL,
user_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_reminded tinyint(4) DEFAULT '0' NOT NULL,
+ user_reminded_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (user_id),
KEY user_birthday (user_birthday),
KEY user_email_hash (user_email_hash),
diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql
index 2623202d4a..651a842f8f 100644
--- a/phpBB/install/schemas/mysql_41_schema.sql
+++ b/phpBB/install/schemas/mysql_41_schema.sql
@@ -554,6 +554,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation varchar(20) DEFAULT '' NOT NULL,
field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
+ field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_hide tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
field_no_view tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
@@ -971,6 +972,8 @@ CREATE TABLE phpbb_users (
user_newpasswd varchar(40) DEFAULT '' NOT NULL,
user_form_salt varchar(32) DEFAULT '' NOT NULL,
user_new tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
+ user_reminded tinyint(4) DEFAULT '0' NOT NULL,
+ user_reminded_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (user_id),
KEY user_birthday (user_birthday),
KEY user_email_hash (user_email_hash),
diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql
index 05d25db87c..df707db3c5 100644
--- a/phpBB/install/schemas/oracle_schema.sql
+++ b/phpBB/install/schemas/oracle_schema.sql
@@ -1060,6 +1060,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation varchar2(60) DEFAULT '' ,
field_required number(1) DEFAULT '0' NOT NULL,
field_show_on_reg number(1) DEFAULT '0' NOT NULL,
+ field_show_on_vt number(1) DEFAULT '0' NOT NULL,
field_show_profile number(1) DEFAULT '0' NOT NULL,
field_hide number(1) DEFAULT '0' NOT NULL,
field_no_view number(1) DEFAULT '0' NOT NULL,
@@ -1791,6 +1792,8 @@ CREATE TABLE phpbb_users (
user_newpasswd varchar2(120) DEFAULT '' ,
user_form_salt varchar2(96) DEFAULT '' ,
user_new number(1) DEFAULT '1' NOT NULL,
+ user_reminded number(4) DEFAULT '0' NOT NULL,
+ user_reminded_time number(11) DEFAULT '0' NOT NULL,
CONSTRAINT pk_phpbb_users PRIMARY KEY (user_id),
CONSTRAINT u_phpbb_username_clean UNIQUE (username_clean)
)
diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql
index bb4d839272..66bd206928 100644
--- a/phpBB/install/schemas/postgres_schema.sql
+++ b/phpBB/install/schemas/postgres_schema.sql
@@ -741,6 +741,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation varchar(20) DEFAULT '' NOT NULL,
field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0),
field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0),
+ field_show_on_vt INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_vt >= 0),
field_show_profile INT2 DEFAULT '0' NOT NULL CHECK (field_show_profile >= 0),
field_hide INT2 DEFAULT '0' NOT NULL CHECK (field_hide >= 0),
field_no_view INT2 DEFAULT '0' NOT NULL CHECK (field_no_view >= 0),
@@ -1234,6 +1235,8 @@ CREATE TABLE phpbb_users (
user_newpasswd varchar(40) DEFAULT '' NOT NULL,
user_form_salt varchar(32) DEFAULT '' NOT NULL,
user_new INT2 DEFAULT '1' NOT NULL CHECK (user_new >= 0),
+ user_reminded INT2 DEFAULT '0' NOT NULL,
+ user_reminded_time INT4 DEFAULT '0' NOT NULL CHECK (user_reminded_time >= 0),
PRIMARY KEY (user_id)
);
diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql
index 4ee981c667..4741baf559 100644
--- a/phpBB/install/schemas/sqlite_schema.sql
+++ b/phpBB/install/schemas/sqlite_schema.sql
@@ -537,6 +537,7 @@ CREATE TABLE phpbb_profile_fields (
field_validation varchar(20) NOT NULL DEFAULT '',
field_required INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0',
+ field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_show_profile INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_hide INTEGER UNSIGNED NOT NULL DEFAULT '0',
field_no_view INTEGER UNSIGNED NOT NULL DEFAULT '0',
@@ -940,7 +941,9 @@ CREATE TABLE phpbb_users (
user_actkey varchar(32) NOT NULL DEFAULT '',
user_newpasswd varchar(40) NOT NULL DEFAULT '',
user_form_salt varchar(32) NOT NULL DEFAULT '',
- user_new INTEGER UNSIGNED NOT NULL DEFAULT '1'
+ user_new INTEGER UNSIGNED NOT NULL DEFAULT '1',
+ user_reminded tinyint(4) NOT NULL DEFAULT '0',
+ user_reminded_time INTEGER UNSIGNED NOT NULL DEFAULT '0'
);
CREATE INDEX phpbb_users_user_birthday ON phpbb_users (user_birthday);
diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php
index ef291585bc..a25dcd174b 100644
--- a/phpBB/language/en/acp/profile.php
+++ b/phpBB/language/en/acp/profile.php
@@ -66,6 +66,8 @@ $lang = array_merge($lang, array(
'DISPLAY_AT_PROFILE_EXPLAIN' => 'The user is able to change this profile field within the user control panel.',
'DISPLAY_AT_REGISTER' => 'Display on registration screen',
'DISPLAY_AT_REGISTER_EXPLAIN' => 'If this option is enabled, the field will be displayed on registration.',
+ 'DISPLAY_ON_VT' => 'Display on viewtopic screen',
+ 'DISPLAY_ON_VT_EXPLAIN' => 'If this option is enabled, the field will be displayed in the mini-profile on the topic screen.',
'DISPLAY_PROFILE_FIELD' => 'Publicly display profile field',
'DISPLAY_PROFILE_FIELD_EXPLAIN' => 'The profile field will be shown in all locations allowed within the load settings. Setting this to “no” will hide the field from topic pages, profiles and the memberlist.',
'DROPDOWN_ENTRIES_EXPLAIN' => 'Enter your options now, every option in one line.',
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 52bae414df..fc96f0c901 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1179,7 +1179,22 @@ if ($config['load_cpf_viewtopic'])
$cp = new custom_profile();
// Grab all profile fields from users in id cache for later use - similar to the poster cache
- $profile_fields_cache = $cp->generate_profile_fields_template('grab', $id_cache);
+ $profile_fields_tmp = $cp->generate_profile_fields_template('grab', $id_cache);
+
+ // filter out fields not to be displayed on viewtopic. Yes, it's a hack, but this shouldn't break any MODs.
+ $profile_fields_cache = array();
+ foreach ($profile_fields_tmp as $profile_user_id => $profile_fields)
+ {
+ $profile_fields_cache[$profile_user_id] = array();
+ foreach ($profile_fields as $used_ident => $profile_field)
+ {
+ if ($profile_field['data']['field_show_on_vt'])
+ {
+ $profile_fields_cache[$profile_user_id][$used_ident] = $profile_field;
+ }
+ }
+ }
+ unset($profile_fields_tmp);
}
// Generate online information for user