Index: language/en/acp/board.php
===================================================================
--- language/en/acp/board.php (revision 9902)
+++ language/en/acp/board.php (working copy)
@@ -343,6 +343,7 @@
'LOAD_CPF_MEMBERLIST' => 'Allow styles to display custom profile fields in memberlist',
'LOAD_CPF_VIEWPROFILE' => 'Display custom profile fields in user profiles',
'LOAD_CPF_VIEWTOPIC' => 'Display custom profile fields on topic pages',
+ 'LOAD_CPF_PM' => 'Display custom profile fields in private messages',
'LOAD_USER_ACTIVITY' => 'Show user’s activity',
'LOAD_USER_ACTIVITY_EXPLAIN' => 'Displays active topic/forum in user profiles and user control panel. It is recommended to disable this on boards with more than one million posts.',
'RECOMPILE_STYLES' => 'Recompile stale style components',
Index: styles/prosilver/template/ucp_pm_viewmessage.html
===================================================================
--- styles/prosilver/template/ucp_pm_viewmessage.html (revision 9902)
+++ styles/prosilver/template/ucp_pm_viewmessage.html (working copy)
@@ -72,6 +72,10 @@
{L_JOINED}: {AUTHOR_JOINED}
{L_LOCATION}: {AUTHOR_FROM}
+
+ {custom_fields.PROFILE_FIELD_NAME}: {custom_fields.PROFILE_FIELD_VALUE}
+
+
Index: includes/acp/acp_board.php
===================================================================
--- includes/acp/acp_board.php (revision 9902)
+++ includes/acp/acp_board.php (working copy)
@@ -318,6 +318,7 @@
'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
+ 'load_cpf_pm' => array('lang' => 'LOAD_CPF_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'legend4' => 'ACP_SUBMIT_CHANGES',
)
Index: includes/ucp/ucp_pm_viewmessage.php
===================================================================
--- includes/ucp/ucp_pm_viewmessage.php (revision 9902)
+++ includes/ucp/ucp_pm_viewmessage.php (working copy)
@@ -21,7 +21,7 @@
*/
function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
{
- global $user, $template, $auth, $db, $cache;
+ global $user, $template, $auth, $db, $cache, $config;
global $phpbb_root_path, $phpEx, $config;
$user->add_lang(array('viewtopic', 'memberlist'));
@@ -226,6 +226,32 @@
'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '',
'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '')
);
+
+ // Custom profile fields
+ // Load custom profile fields
+ if ($config['load_cpf_pm'])
+ {
+ if (!class_exists('custom_profile'))
+ {
+ include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
+ }
+ $cp = new custom_profile();
+
+ // Fetch the data
+ $profile_fields_data = $cp->generate_profile_fields_template('grab', $author_id);
+
+ if (isset($profile_fields_data[$author_id]))
+ {
+ // Get the template data
+ $profile_fields_tpl = $cp->generate_profile_fields_template('show', false, $profile_fields_data[$author_id]);
+
+ // Assign
+ foreach ($profile_fields_tpl['blockrow'] as $profile_field)
+ {
+ $template->assign_block_vars('custom_fields', $profile_field);
+ }
+ }
+ }
// Display not already displayed Attachments for this post, we already parsed them. ;)
if (isset($attachments) && sizeof($attachments))
Index: install/schemas/schema_data.sql
===================================================================
--- install/schemas/schema_data.sql (revision 9902)
+++ install/schemas/schema_data.sql (working copy)
@@ -157,6 +157,7 @@
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_memberlist', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewprofile', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_viewtopic', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_cpf_pm', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_lastread', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_db_track', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_jumpbox', '1');
Index: install/database_update.php
===================================================================
--- install/database_update.php (revision 9902)
+++ install/database_update.php (working copy)
@@ -1090,6 +1090,9 @@
// Entry for reporting PMs
set_config('allow_pm_report', '1');
+
+ // Custom profile fields in PMs
+ set_config('load_cpf_pm', '0');
include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);