diff options
author | Nils Adermann <naderman@naderman.de> | 2014-02-11 02:18:16 +0100 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2014-02-11 02:18:16 +0100 |
commit | 0b2b76f9514fed54c92e439eadbef6dc80290cd3 (patch) | |
tree | 779a80bc5d106afaff20a28675ba7e69771a7262 | |
parent | b088bf864bf5827c1801c53c0af1b5a2f89f5b16 (diff) | |
parent | 5550f0fa870d531879d53d1bfdd76dcd29a16ce6 (diff) | |
download | forums-0b2b76f9514fed54c92e439eadbef6dc80290cd3.tar forums-0b2b76f9514fed54c92e439eadbef6dc80290cd3.tar.gz forums-0b2b76f9514fed54c92e439eadbef6dc80290cd3.tar.bz2 forums-0b2b76f9514fed54c92e439eadbef6dc80290cd3.tar.xz forums-0b2b76f9514fed54c92e439eadbef6dc80290cd3.zip |
Merge pull request #2010 from nickvergessen/ticket/12169
Ticket/12169 Convert location user field to profile field
34 files changed, 207 insertions, 63 deletions
diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html index 44c9cb6d49..04e6d9f12b 100644 --- a/phpBB/adm/style/acp_profile.html +++ b/phpBB/adm/style/acp_profile.html @@ -64,6 +64,10 @@ <dd><input type="checkbox" class="radio" id="field_show_on_vt" name="field_show_on_vt" value="1"<!-- IF S_SHOW_ON_VT --> checked="checked"<!-- ENDIF --> /></dd> </dl> <dl> + <dt><label for="field_show_on_ml">{L_DISPLAY_ON_MEMBERLIST}{L_COLON}</label><br /><span>{L_DISPLAY_ON_MEMBERLIST_EXPLAIN}</span></dt> + <dd><input type="checkbox" class="radio" id="field_show_on_ml" name="field_show_on_ml" value="1"<!-- IF S_SHOW_ON_MEMBERLIST --> checked="checked"<!-- ENDIF --> /></dd> + </dl> + <dl> <dt><label for="field_required">{L_REQUIRED_FIELD}{L_COLON}</label><br /><span>{L_REQUIRED_FIELD_EXPLAIN}</span></dt> <dd><input type="checkbox" class="radio" id="field_required" name="field_required" value="1"<!-- IF S_FIELD_REQUIRED --> checked="checked"<!-- ENDIF --> /></dd> </dl> diff --git a/phpBB/adm/style/acp_users_profile.html b/phpBB/adm/style/acp_users_profile.html index 2c9965687a..f4a3c06e67 100644 --- a/phpBB/adm/style/acp_users_profile.html +++ b/phpBB/adm/style/acp_users_profile.html @@ -27,10 +27,6 @@ <dd><input type="url" id="website" name="website" value="{WEBSITE}" /></dd> </dl> <dl> - <dt><label for="location">{L_LOCATION}{L_COLON}</label></dt> - <dd><input type="text" id="location" name="location" value="{LOCATION}" /></dd> - </dl> - <dl> <dt><label for="birthday">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt> <dd>{L_DAY}{L_COLON} <select id="birthday" name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> {L_MONTH}{L_COLON} <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> {L_YEAR}{L_COLON} <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></dd> </dl> diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php index 16f10b1225..d5eaed3bc7 100644 --- a/phpBB/develop/benchmark.php +++ b/phpBB/develop/benchmark.php @@ -368,7 +368,6 @@ function make_user($username) $email = "nobody@localhost"; $icq = "12345678"; $website = "http://www.phpbb.com"; - $location = "phpBB world hq"; $signature = "$username: phpBB tester."; $signature_bbcode_uid = ""; $avatar_filename = ""; @@ -420,8 +419,8 @@ function make_user($username) } - $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_from, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) - VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$icq', '$website', '$location', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, "; + $sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_sig, user_sig_bbcode_uid, user_avatar, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmilies, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey) + VALUES ($new_user_id, '$username', " . time() . ", '$password', '$email', '$icq', '$website', '$signature', '$signature_bbcode_uid', '$avatar_filename', $viewemail, '$aim', '$yim', '$msn', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $user_timezone, '$user_dateformat', '$user_lang', $user_style, 0, 1, "; $sql .= "1, '')"; diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 2fa1f38bd3..3a5298fb58 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -385,6 +385,7 @@ class acp_profile 'field_show_on_reg' => 0, 'field_show_on_pm' => 0, 'field_show_on_vt' => 0, + 'field_show_on_ml' => 0, 'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)), 'lang_explain' => '', 'lang_default_value'=> '') @@ -395,7 +396,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_show_on_pm', 'field_show_on_vt', 'field_required', 'field_show_novalue', '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_pm', 'field_show_on_vt', 'field_show_on_ml', 'field_required', 'field_show_novalue', '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') ); @@ -407,6 +408,7 @@ class acp_profile 'field_show_on_reg', 'field_show_on_pm', 'field_show_on_vt', + 'field_show_on_ml', 'field_show_profile', 'field_hide', ); @@ -620,6 +622,7 @@ class acp_profile 'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false, 'S_SHOW_ON_PM' => ($cp->vars['field_show_on_pm']) ? true : false, 'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false, + 'S_SHOW_ON_MEMBERLIST'=> ($cp->vars['field_show_on_ml']) ? 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, @@ -880,6 +883,7 @@ class acp_profile 'field_show_on_reg' => $cp->vars['field_show_on_reg'], 'field_show_on_pm' => $cp->vars['field_show_on_pm'], 'field_show_on_vt' => $cp->vars['field_show_on_vt'], + 'field_show_on_ml' => $cp->vars['field_show_on_ml'], '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/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 6a81f919e4..fbff6a73da 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1367,7 +1367,6 @@ class acp_users 'yim' => request_var('yim', $user_row['user_yim']), 'jabber' => utf8_normalize_nfc(request_var('jabber', $user_row['user_jabber'], true)), 'website' => request_var('website', $user_row['user_website']), - 'location' => utf8_normalize_nfc(request_var('location', $user_row['user_from'], true)), 'bday_day' => 0, 'bday_month' => 0, 'bday_year' => 0, @@ -1399,7 +1398,6 @@ class acp_users 'website' => array( array('string', true, 12, 255), array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), - 'location' => array('string', true, 2, 100), 'bday_day' => array('num', true, 1, 31), 'bday_month' => array('num', true, 1, 12), 'bday_year' => array('num', true, 1901, gmdate('Y', time())), @@ -1427,7 +1425,6 @@ class acp_users 'user_yim' => $data['yim'], 'user_jabber' => $data['jabber'], 'user_website' => $data['website'], - 'user_from' => $data['location'], 'user_birthday' => $data['user_birthday'], ); @@ -1477,7 +1474,6 @@ class acp_users 'MSN' => $data['msn'], 'JABBER' => $data['jabber'], 'WEBSITE' => $data['website'], - 'LOCATION' => $data['location'], 'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options, 'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options, diff --git a/phpBB/includes/db/schema_data.php b/phpBB/includes/db/schema_data.php index cb09116856..9d7153f6b6 100644 --- a/phpBB/includes/db/schema_data.php +++ b/phpBB/includes/db/schema_data.php @@ -771,6 +771,7 @@ $schema_data['phpbb_profile_fields'] = array( 'field_show_on_reg' => array('BOOL', 0), 'field_show_on_pm' => array('BOOL', 0), 'field_show_on_vt' => array('BOOL', 0), + 'field_show_on_ml' => array('BOOL', 0), 'field_show_profile' => array('BOOL', 0), 'field_hide' => array('BOOL', 0), 'field_no_view' => array('BOOL', 0), @@ -787,6 +788,7 @@ $schema_data['phpbb_profile_fields'] = array( $schema_data['phpbb_profile_fields_data'] = array( 'COLUMNS' => array( 'user_id' => array('UINT', 0), + 'pf_phpbb_location' => array('VCHAR', ''), 'pf_phpbb_interests' => array('TEXT_UNI', ''), 'pf_phpbb_occupation' => array('TEXT_UNI', ''), ), @@ -1165,7 +1167,6 @@ $schema_data['phpbb_users'] = array( 'user_sig' => array('MTEXT_UNI', ''), 'user_sig_bbcode_uid' => array('VCHAR:8', ''), 'user_sig_bbcode_bitfield' => array('VCHAR:255', ''), - 'user_from' => array('VCHAR_UNI:100', ''), 'user_icq' => array('VCHAR:15', ''), 'user_aim' => array('VCHAR_UNI', ''), 'user_yim' => array('VCHAR_UNI', ''), diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 119b84564a..f9e8e3155e 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -188,7 +188,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '', 'AUTHOR_JOINED' => $user->format_date($user_info['user_regdate']), 'AUTHOR_POSTS' => (int) $user_info['user_posts'], - 'AUTHOR_FROM' => (!empty($user_info['user_from'])) ? $user_info['user_from'] : '', 'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : ((isset($user_info['online']) && $user_info['online']) ? $user->img('icon_user_online', $user->lang['ONLINE']) : $user->img('icon_user_offline', $user->lang['OFFLINE'])), 'S_ONLINE' => (!$config['load_onlinetrack']) ? false : ((isset($user_info['online']) && $user_info['online']) ? true : false), diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 22b180ba89..8def48b1b4 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -270,7 +270,6 @@ class ucp_profile 'yim' => request_var('yim', $user->data['user_yim']), 'jabber' => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)), 'website' => request_var('website', $user->data['user_website']), - 'location' => utf8_normalize_nfc(request_var('location', $user->data['user_from'], true)), ); if ($config['allow_birthdays']) @@ -305,7 +304,6 @@ class ucp_profile 'website' => array( array('string', true, 12, 255), array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')), - 'location' => array('string', true, 2, 100), ); if ($config['allow_birthdays']) @@ -351,7 +349,6 @@ class ucp_profile 'user_yim' => $data['yim'], 'user_jabber' => $data['jabber'], 'user_website' => $data['website'], - 'user_from' => $data['location'], 'user_notify_type' => $data['notify'], ); @@ -420,7 +417,6 @@ class ucp_profile 'MSN' => $data['msn'], 'JABBER' => $data['jabber'], 'WEBSITE' => $data['website'], - 'LOCATION' => $data['location'], )); // Get additional profile fields and assign them to the template block var 'profile_fields' diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 2effbf49b9..94f685fa2f 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -912,7 +912,6 @@ if (!$get_info) array('user_yim', 'users.user_yim', array('function1' => 'phpbb_set_encoding')), array('user_aim', 'users.user_aim', array('function1' => 'phpbb_set_encoding')), array('user_icq', 'users.user_icq', array('function1' => 'phpbb_set_encoding')), - array('user_from', 'users.user_from', array('function1' => 'phpbb_set_encoding')), array('user_rank', 'users.user_rank', 'intval'), array('user_permissions', '', ''), @@ -963,6 +962,7 @@ if (!$get_info) array('user_id', 'users.user_id', 'phpbb_user_id'), array('pf_phpbb_occupation', 'users.user_occ', array('function1' => 'phpbb_set_encoding')), array('pf_phpbb_interests', 'users.user_interests', array('function1' => 'phpbb_set_encoding')), + array('pf_phpbb_location', 'users.user_from', array('function1' => 'phpbb_set_encoding')), 'where' => 'users.user_id <> -1', ), diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index c717cb7416..937b06eaae 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -921,6 +921,7 @@ CREATE TABLE phpbb_profile_fields ( field_show_on_reg INTEGER DEFAULT 0 NOT NULL, field_show_on_pm INTEGER DEFAULT 0 NOT NULL, field_show_on_vt INTEGER DEFAULT 0 NOT NULL, + field_show_on_ml 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, @@ -947,6 +948,7 @@ END;; # Table: 'phpbb_profile_fields_data' CREATE TABLE phpbb_profile_fields_data ( user_id INTEGER DEFAULT 0 NOT NULL, + pf_phpbb_location VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, pf_phpbb_interests BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, pf_phpbb_occupation BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; @@ -1418,7 +1420,6 @@ CREATE TABLE phpbb_users ( user_sig BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, user_sig_bbcode_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, user_sig_bbcode_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, - user_from VARCHAR(100) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, user_icq VARCHAR(15) CHARACTER SET NONE DEFAULT '' NOT NULL, user_aim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, user_yim VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 9d7d0e324b..5df33e8057 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1127,6 +1127,7 @@ CREATE TABLE [phpbb_profile_fields] ( [field_show_on_reg] [int] DEFAULT (0) NOT NULL , [field_show_on_pm] [int] DEFAULT (0) NOT NULL , [field_show_on_vt] [int] DEFAULT (0) NOT NULL , + [field_show_on_ml] [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 , @@ -1154,6 +1155,7 @@ GO */ CREATE TABLE [phpbb_profile_fields_data] ( [user_id] [int] DEFAULT (0) NOT NULL , + [pf_phpbb_location] [varchar] (255) DEFAULT ('') NOT NULL , [pf_phpbb_interests] [varchar] (4000) DEFAULT ('') NOT NULL , [pf_phpbb_occupation] [varchar] (4000) DEFAULT ('') NOT NULL ) ON [PRIMARY] @@ -1734,7 +1736,6 @@ CREATE TABLE [phpbb_users] ( [user_sig] [text] DEFAULT ('') NOT NULL , [user_sig_bbcode_uid] [varchar] (8) DEFAULT ('') NOT NULL , [user_sig_bbcode_bitfield] [varchar] (255) DEFAULT ('') NOT NULL , - [user_from] [varchar] (100) DEFAULT ('') NOT NULL , [user_icq] [varchar] (15) DEFAULT ('') NOT NULL , [user_aim] [varchar] (255) DEFAULT ('') NOT NULL , [user_yim] [varchar] (255) DEFAULT ('') NOT NULL , diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index b5ccb6c783..e546c2e98f 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -658,6 +658,7 @@ CREATE TABLE phpbb_profile_fields ( field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_show_on_ml 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, @@ -672,6 +673,7 @@ CREATE TABLE phpbb_profile_fields ( # Table: 'phpbb_profile_fields_data' CREATE TABLE phpbb_profile_fields_data ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + pf_phpbb_location varbinary(255) DEFAULT '' NOT NULL, pf_phpbb_interests blob NOT NULL, pf_phpbb_occupation blob NOT NULL, PRIMARY KEY (user_id) @@ -1027,7 +1029,6 @@ CREATE TABLE phpbb_users ( user_sig mediumblob NOT NULL, user_sig_bbcode_uid varbinary(8) DEFAULT '' NOT NULL, user_sig_bbcode_bitfield varbinary(255) DEFAULT '' NOT NULL, - user_from blob NOT NULL, user_icq varbinary(15) DEFAULT '' NOT NULL, user_aim blob NOT NULL, user_yim blob NOT NULL, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 9e911560db..eec7b985b0 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -658,6 +658,7 @@ CREATE TABLE phpbb_profile_fields ( field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_pm tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_show_on_ml 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, @@ -672,6 +673,7 @@ CREATE TABLE phpbb_profile_fields ( # Table: 'phpbb_profile_fields_data' CREATE TABLE phpbb_profile_fields_data ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + pf_phpbb_location varchar(255) DEFAULT '' NOT NULL, pf_phpbb_interests text NOT NULL, pf_phpbb_occupation text NOT NULL, PRIMARY KEY (user_id) @@ -1027,7 +1029,6 @@ CREATE TABLE phpbb_users ( user_sig mediumtext NOT NULL, user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL, user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, - user_from varchar(100) DEFAULT '' NOT NULL, user_icq varchar(15) DEFAULT '' NOT NULL, user_aim varchar(255) DEFAULT '' NOT NULL, user_yim varchar(255) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index b752908ef8..ad8d354db9 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1230,6 +1230,7 @@ CREATE TABLE phpbb_profile_fields ( field_show_on_reg number(1) DEFAULT '0' NOT NULL, field_show_on_pm number(1) DEFAULT '0' NOT NULL, field_show_on_vt number(1) DEFAULT '0' NOT NULL, + field_show_on_ml 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, @@ -1265,6 +1266,7 @@ END; */ CREATE TABLE phpbb_profile_fields_data ( user_id number(8) DEFAULT '0' NOT NULL, + pf_phpbb_location varchar2(255) DEFAULT '' , pf_phpbb_interests clob DEFAULT '' , pf_phpbb_occupation clob DEFAULT '' , CONSTRAINT pk_phpbb_profile_fields_data PRIMARY KEY (user_id) @@ -1851,7 +1853,6 @@ CREATE TABLE phpbb_users ( user_sig clob DEFAULT '' , user_sig_bbcode_uid varchar2(8) DEFAULT '' , user_sig_bbcode_bitfield varchar2(255) DEFAULT '' , - user_from varchar2(300) DEFAULT '' , user_icq varchar2(15) DEFAULT '' , user_aim varchar2(765) DEFAULT '' , user_yim varchar2(765) DEFAULT '' , diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 229a57a11b..4412e29d09 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -866,6 +866,7 @@ CREATE TABLE phpbb_profile_fields ( field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0), field_show_on_pm INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_pm >= 0), field_show_on_vt INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_vt >= 0), + field_show_on_ml INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_ml >= 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), @@ -882,6 +883,7 @@ CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order) */ CREATE TABLE phpbb_profile_fields_data ( user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), + pf_phpbb_location varchar(255) DEFAULT '' NOT NULL, pf_phpbb_interests varchar(4000) DEFAULT '' NOT NULL, pf_phpbb_occupation varchar(4000) DEFAULT '' NOT NULL, PRIMARY KEY (user_id) @@ -1299,7 +1301,6 @@ CREATE TABLE phpbb_users ( user_sig TEXT DEFAULT '' NOT NULL, user_sig_bbcode_uid varchar(8) DEFAULT '' NOT NULL, user_sig_bbcode_bitfield varchar(255) DEFAULT '' NOT NULL, - user_from varchar(100) DEFAULT '' NOT NULL, user_icq varchar(15) DEFAULT '' NOT NULL, user_aim varchar(255) DEFAULT '' NOT NULL, user_yim varchar(255) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index f888c7a0fe..2aff81a6a5 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -467,10 +467,10 @@ INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts_approved, forum_posts_unapproved, forum_posts_softdeleted, forum_topics_approved, forum_topics_unapproved, forum_topics_softdeleted, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_subject, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents, forum_flags) VALUES ('{L_FORUMS_TEST_FORUM_TITLE}', '{L_FORUMS_TEST_FORUM_DESC}', 2, 3, 1, 1, 1, 0, 0, 1, 0, 0, 1, 2, 'Admin', 'AA0000', '{L_TOPICS_TOPIC_TITLE}', 972086460, '', '', '', '', '', '', '', 0, 0, '', 48); # -- Users / Anonymous user -INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_actkey, user_newpasswd, user_allow_massemail) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', 0); +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_actkey, user_newpasswd, user_allow_massemail) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', 0); # -- username: Admin password: admin (change this or remove it once everything is working!) -INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', ''); +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', ''); # -- Groups INSERT INTO phpbb_groups (group_name, group_type, group_founder_manage, group_colour, group_legend, group_avatar, group_desc, group_desc_uid, group_max_recipients) VALUES ('GUESTS', 3, 0, '', 0, '', '', '', 5); @@ -788,8 +788,9 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogg'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogm'); # Add default profile fields -INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_profile, field_hide, field_no_view, field_active, field_order) VALUES ('phpbb_interests', 'profilefields.type.text', 'phpbb_interests', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 1, 0, 0, 1, 1); -INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_profile, field_hide, field_no_view, field_active, field_order) VALUES ('phpbb_occupation', 'profilefields.type.text', 'phpbb_occupation', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 1, 0, 0, 1, 2); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order) VALUES ('phpbb_location', 'profilefields.type.string', 'phpbb_location', '20', '2', '100', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order) VALUES ('phpbb_interests', 'profilefields.type.text', 'phpbb_interests', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order) VALUES ('phpbb_occupation', 'profilefields.type.text', 'phpbb_occupation', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 3); # User Notification Options (for first user) INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('post', 0, 2, ''); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 4b1ad2ce46..644cf775eb 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -639,6 +639,7 @@ CREATE TABLE phpbb_profile_fields ( field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0', field_show_on_pm INTEGER UNSIGNED NOT NULL DEFAULT '0', field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0', + field_show_on_ml 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', @@ -652,6 +653,7 @@ CREATE INDEX phpbb_profile_fields_fld_ordr ON phpbb_profile_fields (field_order) # Table: 'phpbb_profile_fields_data' CREATE TABLE phpbb_profile_fields_data ( user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', + pf_phpbb_location varchar(255) NOT NULL DEFAULT '', pf_phpbb_interests text(65535) NOT NULL DEFAULT '', pf_phpbb_occupation text(65535) NOT NULL DEFAULT '', PRIMARY KEY (user_id) @@ -998,7 +1000,6 @@ CREATE TABLE phpbb_users ( user_sig mediumtext(16777215) NOT NULL DEFAULT '', user_sig_bbcode_uid varchar(8) NOT NULL DEFAULT '', user_sig_bbcode_bitfield varchar(255) NOT NULL DEFAULT '', - user_from varchar(100) NOT NULL DEFAULT '', user_icq varchar(15) NOT NULL DEFAULT '', user_aim varchar(255) NOT NULL DEFAULT '', user_yim varchar(255) NOT NULL DEFAULT '', diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index 8509845860..726a9bac82 100644 --- a/phpBB/language/en/acp/profile.php +++ b/phpBB/language/en/acp/profile.php @@ -65,6 +65,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_MEMBERLIST' => 'Display on memberlist screen', + 'DISPLAY_ON_MEMBERLIST_EXPLAIN' => 'If this option is enabled, the field will be displayed in the user rows on the memberlist screen.', 'DISPLAY_ON_PM' => 'Display on view pm screen', 'DISPLAY_ON_PM_EXPLAIN' => 'If this option is enabled, the field will be displayed in the mini-profile on the pm screen.', 'DISPLAY_ON_VT' => 'Display on viewtopic screen', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index bf03393b52..896d2ef811 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -685,7 +685,6 @@ $lang = array_merge($lang, array( 'TOO_LONG_DATEFORMAT' => 'The date format you entered is too long.', 'TOO_LONG_ICQ' => 'The ICQ number you entered is too long.', 'TOO_LONG_JABBER' => 'The Jabber account name you entered is too long.', - 'TOO_LONG_LOCATION' => 'The location you entered is too long.', 'TOO_LONG_MSN' => 'The WLM name you entered is too long.', 'TOO_LONG_NEW_PASSWORD' => 'The password you entered is too long.', 'TOO_LONG_PASSWORD_CONFIRM' => 'The password confirmation you entered is too long.', @@ -704,7 +703,6 @@ $lang = array_merge($lang, array( 'TOO_SHORT_DATEFORMAT' => 'The date format you entered is too short.', 'TOO_SHORT_ICQ' => 'The ICQ number you entered is too short.', 'TOO_SHORT_JABBER' => 'The Jabber account name you entered is too short.', - 'TOO_SHORT_LOCATION' => 'The location you entered is too short.', 'TOO_SHORT_MSN' => 'The WLM name you entered is too short.', 'TOO_SHORT_NEW_PASSWORD' => 'The password you entered is too short.', 'TOO_SHORT_PASSWORD_CONFIRM' => 'The password confirmation you entered is too short.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index e8cbcc94ef..16e4c86a4e 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -998,8 +998,8 @@ switch ($mode) $pagination = $phpbb_container->get('pagination'); // Sorting - $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'f' => $user->lang['WEBSITE'], 'g' => $user->lang['ICQ'], 'h' => $user->lang['AIM'], 'i' => $user->lang['MSNM'], 'j' => $user->lang['YIM'], 'k' => $user->lang['JABBER']); - $sort_key_sql = array('a' => 'u.username_clean', 'b' => 'u.user_from', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'f' => 'u.user_website', 'g' => 'u.user_icq', 'h' => 'u.user_aim', 'i' => 'u.user_msnm', 'j' => 'u.user_yim', 'k' => 'u.user_jabber'); + $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'f' => $user->lang['WEBSITE'], 'g' => $user->lang['ICQ'], 'h' => $user->lang['AIM'], 'i' => $user->lang['MSNM'], 'j' => $user->lang['YIM'], 'k' => $user->lang['JABBER']); + $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'f' => 'u.user_website', 'g' => 'u.user_icq', 'h' => 'u.user_aim', 'i' => 'u.user_msnm', 'j' => 'u.user_yim', 'k' => 'u.user_jabber'); if ($auth->acl_get('a_user')) { @@ -1502,6 +1502,19 @@ switch ($mode) $user_list[] = (int) $row['user_id']; } $db->sql_freeresult($result); + + // Load custom profile fields + if ($config['load_cpf_memberlist']) + { + $cp = $phpbb_container->get('profilefields.manager'); + + $cp_row = $cp->generate_profile_fields_template_headlines('field_show_on_ml'); + foreach ($cp_row as $profile_field) + { + $template->assign_block_vars('custom_fields', $profile_field); + } + } + $leaders_set = false; // So, did we get any users? if (sizeof($user_list)) @@ -1552,10 +1565,20 @@ switch ($mode) // Load custom profile fields if ($config['load_cpf_memberlist']) { - $cp = $phpbb_container->get('profilefields.manager'); - // 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', $user_list); + + // Filter the fields we don't want to show + foreach ($profile_fields_cache as $user_id => $user_profile_fields) + { + foreach ($user_profile_fields as $field_ident => $profile_field) + { + if (!$profile_field['data']['field_show_on_ml']) + { + unset($profile_fields_cache[$user_id][$field_ident]); + } + } + } } // If we sort by last active date we need to adjust the id cache due to user_lastvisit not being the last active date... @@ -1627,12 +1650,10 @@ switch ($mode) 'U_FIND_MEMBER' => ($config['load_search'] || $auth->acl_get('a_')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser' . (($start) ? "&start=$start" : '') . (!empty($params) ? '&' . implode('&', $params) : '')) : '', 'U_HIDE_FIND_MEMBER' => ($mode == 'searchuser' || ($mode == '' && $submit)) ? $u_hide_find_member : '', 'U_SORT_USERNAME' => $sort_url . '&sk=a&sd=' . (($sort_key == 'a' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_FROM' => $sort_url . '&sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_JOINED' => $sort_url . '&sk=c&sd=' . (($sort_key == 'c' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_POSTS' => $sort_url . '&sk=d&sd=' . (($sort_key == 'd' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_EMAIL' => $sort_url . '&sk=e&sd=' . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_WEBSITE' => $sort_url . '&sk=f&sd=' . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_LOCATION' => $sort_url . '&sk=b&sd=' . (($sort_key == 'b' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_ICQ' => $sort_url . '&sk=g&sd=' . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_AIM' => $sort_url . '&sk=h&sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_MSN' => $sort_url . '&sk=i&sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'), @@ -1764,7 +1785,6 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f 'U_YIM' => ($data['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($data['user_yim']) . '&.src=pg' : '', 'U_MSN' => ($data['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=msnm&u=' . $user_id) : '', 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $user_id) : '', - 'LOCATION' => ($data['user_from']) ? $data['user_from'] : '', 'USER_ICQ' => $data['user_icq'], 'USER_AIM' => $data['user_aim'], diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_location.php b/phpBB/phpbb/db/migration/data/v310/profilefield_location.php new file mode 100644 index 0000000000..4e62eab2d7 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/profilefield_location.php @@ -0,0 +1,48 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class profilefield_location extends \phpbb\db\migration\profilefield_base_migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_types', + '\phpbb\db\migration\data\v310\profilefield_on_memberlist', + ); + } + + protected $profilefield_name = 'phpbb_location'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_location', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_location', + 'field_length' => '20', + 'field_minlen' => '2', + 'field_maxlen' => '100', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + ); + + protected $user_column_name = 'user_from'; +} diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php b/phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php new file mode 100644 index 0000000000..ce51944c3e --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/profilefield_on_memberlist.php @@ -0,0 +1,47 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2014 phpBB Group +* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class profilefield_on_memberlist extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields', 'field_show_on_ml'); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\profilefield_cleanup', + ); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_ml' => array('BOOL', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields' => array( + 'field_show_on_ml', + ), + ), + ); + } +} diff --git a/phpBB/phpbb/profilefields/manager.php b/phpBB/phpbb/profilefields/manager.php index ead978374c..6a8d32f150 100644 --- a/phpBB/phpbb/profilefields/manager.php +++ b/phpBB/phpbb/profilefields/manager.php @@ -243,6 +243,39 @@ class manager } /** + * Generate the template arrays in order to display the column names + * + * @param string $restrict_option Restrict the published fields to a certain profile field option + * @return array Returns an array with the template variables type, name and explain for the fields to display + */ + public function generate_profile_fields_template_headlines($restrict_option = '') + { + 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; + } + + /** * 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 */ diff --git a/phpBB/phpbb/profilefields/type/type_string.php b/phpBB/phpbb/profilefields/type/type_string.php index 12a14d9b83..9d241c49ef 100644 --- a/phpBB/phpbb/profilefields/type/type_string.php +++ b/phpBB/phpbb/profilefields/type/type_string.php @@ -60,7 +60,7 @@ class type_string extends type_string_common $options = array( 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" name="field_length" size="5" value="' . $field_data['field_length'] . '" />'), 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" name="field_minlen" size="5" value="' . $field_data['field_minlen'] . '" />'), - 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" size="5" value="' . $field_data['field_maxlen'] . '" />'), + 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" name="field_maxlen" size="5" value="' . $field_data['field_maxlen'] . '" />'), 3 => array('TITLE' => $this->user->lang['FIELD_VALIDATION'], 'FIELD' => '<select name="field_validation">' . $this->validate_options($field_data) . '</select>'), ); diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 606314f9d0..c155d431fa 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -60,7 +60,10 @@ <tr> <th class="name" data-dfn="{L_RANK}{L_COMMA_SEPARATOR}<!-- IF S_SHOW_GROUP and .memberrow -->{L_GROUP_LEADER}<!-- ELSE -->{L_USERNAME}<!-- ENDIF -->"><span class="rank-img"><a href="{U_SORT_RANK}">{L_RANK}</a></span><a href="{U_SORT_USERNAME}"><!-- IF S_SHOW_GROUP and .memberrow -->{L_GROUP_LEADER}<!-- ELSE -->{L_USERNAME}<!-- ENDIF --></a></th> <th class="posts"><a href="{U_SORT_POSTS}#memberlist">{L_POSTS}</a></th> - <th class="info"><a href="{U_SORT_WEBSITE}#memberlist">{L_WEBSITE}</a>{L_COMMA_SEPARATOR}<a href="{U_SORT_LOCATION}">{L_LOCATION}</a></th> + <th class="info"> + <a href="{U_SORT_WEBSITE}#memberlist">{L_WEBSITE}</a> + <!-- BEGIN custom_fields -->{L_COMMA_SEPARATOR} {custom_fields.PROFILE_FIELD_NAME}<!-- END custom_fields --> + </th> <th class="joined"><a href="{U_SORT_JOINED}#memberlist">{L_JOINED}</a></th> <!-- IF U_SORT_ACTIVE --><th class="active"><a href="{U_SORT_ACTIVE}#memberlist">{L_LAST_ACTIVE}</a></th><!-- ENDIF --> </tr> @@ -91,7 +94,10 @@ <!-- IF not S_LEADERS_SET --> <th class="name" data-dfn="{L_RANK}{L_COMMA_SEPARATOR}{L_USERNAME}"><span class="rank-img"><a href="{U_SORT_RANK}">{L_RANK}</a></span><a href="{U_SORT_USERNAME}"><!-- IF S_SHOW_GROUP -->{L_GROUP_MEMBERS}<!-- ELSE -->{L_USERNAME}<!-- ENDIF --></a></th> <th class="posts"><a href="{U_SORT_POSTS}#memberlist">{L_POSTS}</a></th> - <th class="info"><a href="{U_SORT_WEBSITE}#memberlist">{L_WEBSITE}</a>{L_COMMA_SEPARATOR}<a href="{U_SORT_LOCATION}">{L_LOCATION}</a></th> + <th class="info"> + <a href="{U_SORT_WEBSITE}#memberlist">{L_WEBSITE}</a> + <!-- BEGIN custom_fields -->{L_COMMA_SEPARATOR} {custom_fields.PROFILE_FIELD_NAME}<!-- END custom_fields --> + </th> <th class="joined"><a href="{U_SORT_JOINED}#memberlist">{L_JOINED}</a></th> <!-- IF U_SORT_ACTIVE --><th class="active"><a href="{U_SORT_ACTIVE}#memberlist">{L_LAST_ACTIVE}</a></th><!-- ENDIF --> <!-- ELSEIF S_SHOW_GROUP --> @@ -111,7 +117,14 @@ <tr class="<!-- IF memberrow.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->"> <td><!-- IF memberrow.RANK_IMG --><span class="rank-img">{memberrow.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{memberrow.RANK_TITLE}</span><!-- ENDIF --><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input type="checkbox" name="user" value="{memberrow.USERNAME}" /> <!-- ENDIF --><!-- EVENT memberlist_body_username_prepend -->{memberrow.USERNAME_FULL}<!-- EVENT memberlist_body_username_append --><!-- IF S_IN_SEARCH_POPUP --><br />[ <a href="#" onclick="insert_single_user('#results', '{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a> ]<!-- ENDIF --></td> <td class="posts"><!-- IF memberrow.POSTS and S_DISPLAY_SEARCH --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td> - <td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}{L_COLON} {memberrow.U_WWW}">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE --> <!-- ENDIF --></td> + <td class="info"> + <!-- IF memberrow.U_WWW or .memberrow.custom_fields --> + <!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}{L_COLON} {memberrow.U_WWW}">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --> + <!-- BEGIN custom_fields --><div>{memberrow.custom_fields.PROFILE_FIELD_VALUE}</div><!-- END custom_fields --> + <!-- ELSE --> + + <!-- ENDIF --> + </td> <td>{memberrow.JOINED}</td> <!-- IF S_VIEWONLINE --><td>{memberrow.VISITED} </td><!-- ENDIF --> </tr> diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index ca889f2125..1c4b6be2d1 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -27,7 +27,6 @@ <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE --> <!-- ELSE -->{L_RANK}{L_COLON}<!-- ENDIF --></dt> <dd>{RANK_IMG}</dd><!-- ENDIF --> <!-- ENDIF --> <!-- IF S_USER_INACTIVE --><dt>{L_USER_IS_INACTIVE}{L_COLON}</dt> <dd>{USER_INACTIVE_REASON}</dd><!-- ENDIF --> - <!-- IF LOCATION --><dt>{L_LOCATION}{L_COLON}</dt> <dd>{LOCATION}</dd><!-- ENDIF --> <!-- IF AGE !== '' --><dt>{L_AGE}{L_COLON}</dt> <dd>{AGE}</dd><!-- ENDIF --> <!-- IF S_GROUP_OPTIONS --><dt>{L_USERGROUPS}{L_COLON}</dt> <dd><select name="g">{S_GROUP_OPTIONS}</select> <input type="submit" name="submit" value="{L_GO}" class="button2" /></dd><!-- ENDIF --> <!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}{L_COLON}</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields --> diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index 208aeb9399..3623489ccf 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -24,7 +24,6 @@ <dd><strong>{L_POSTS}{L_COLON}</strong> {AUTHOR_POSTS}</dd> <!-- IF AUTHOR_JOINED --><dd><strong>{L_JOINED}{L_COLON}</strong> {AUTHOR_JOINED}</dd><!-- ENDIF --> - <!-- IF AUTHOR_FROM --><dd><strong>{L_LOCATION}{L_COLON}</strong> {AUTHOR_FROM}</dd><!-- ENDIF --> <!-- EVENT ucp_pm_viewmessage_custom_fields_before --> <!-- BEGIN custom_fields --> diff --git a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html index 2de9244721..03b8aa0a14 100644 --- a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html +++ b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html @@ -34,10 +34,6 @@ <dt><label for="website">{L_WEBSITE}{L_COLON}</label></dt> <dd><input type="url" name="website" id="website" maxlength="255" value="{WEBSITE}" class="inputbox" /></dd> </dl> - <dl> - <dt><label for="location">{L_LOCATION}{L_COLON}</label></dt> - <dd><input type="text" name="location" id="location" maxlength="255" value="{LOCATION}" class="inputbox" /></dd> - </dl> <!-- IF S_BIRTHDAYS_ENABLED --> <dl> <dt><label for="bday_day">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt> diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 338c67dd33..1818f9c3d8 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -129,7 +129,6 @@ <!-- IF postrow.POSTER_POSTS != '' --><dd><strong>{L_POSTS}{L_COLON}</strong> {postrow.POSTER_POSTS}</dd><!-- ENDIF --> <!-- IF postrow.POSTER_JOINED --><dd><strong>{L_JOINED}{L_COLON}</strong> {postrow.POSTER_JOINED}</dd><!-- ENDIF --> - <!-- IF postrow.POSTER_FROM --><dd><strong>{L_LOCATION}{L_COLON}</strong> {postrow.POSTER_FROM}</dd><!-- ENDIF --> <!-- IF postrow.S_PROFILE_FIELD1 --> <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html index c143b97522..40d61dddd9 100644 --- a/phpBB/styles/subsilver2/template/memberlist_view.html +++ b/phpBB/styles/subsilver2/template/memberlist_view.html @@ -146,10 +146,6 @@ <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_USERGROUPS}{L_COLON} </td> <td><select name="g">{S_GROUP_OPTIONS}</select> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /></td> </tr> - <tr> - <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_LOCATION}{L_COLON} </td> - <td><!-- IF LOCATION --><b class="genmed">{LOCATION}</b><!-- ENDIF --></td> - </tr> <!-- IF AGE !== '' --> <tr> <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_AGE}{L_COLON} </td> diff --git a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html index 6638eb0266..a565cac5ce 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html @@ -36,10 +36,6 @@ <td class="row1" width="35%"><b class="genmed">{L_WEBSITE}{L_COLON} </b></td> <td class="row2"><input class="post" type="url" name="website" size="30" maxlength="255" value="{WEBSITE}" /></td> </tr> -<tr> - <td class="row1" width="35%"><b class="genmed">{L_LOCATION}{L_COLON} </b></td> - <td class="row2"><input class="post" type="text" name="location" size="30" maxlength="100" value="{LOCATION}" /></td> -</tr> <!-- IF S_BIRTHDAYS_ENABLED --> <tr> <td class="row1" width="35%"><b class="genmed">{L_BIRTHDAY}{L_COLON} </b><br /><span class="gensmall">{L_BIRTHDAY_EXPLAIN}</span></td> diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html index c3f8bf205b..141a38a138 100644 --- a/phpBB/styles/subsilver2/template/viewtopic_body.html +++ b/phpBB/styles/subsilver2/template/viewtopic_body.html @@ -201,7 +201,6 @@ <span class="postdetails"> <!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}{L_COLON}</b> {postrow.POSTER_JOINED}<!-- ENDIF --> <!-- IF postrow.POSTER_POSTS != '' --><br /><b>{L_POSTS}{L_COLON}</b> {postrow.POSTER_POSTS}<!-- ENDIF --> - <!-- IF postrow.POSTER_FROM --><br /><b>{L_LOCATION}{L_COLON}</b> {postrow.POSTER_FROM}<!-- ENDIF --> <!-- IF postrow.S_PROFILE_FIELD1 --> <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index fab8e3b474..7f4c65bd5e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1104,7 +1104,6 @@ while ($row = $db->sql_fetchrow($result)) $user_cache_data = array( 'joined' => '', 'posts' => '', - 'from' => '', 'sig' => '', 'sig_bbcode_uid' => '', @@ -1168,7 +1167,6 @@ while ($row = $db->sql_fetchrow($result)) 'joined' => $user->format_date($row['user_regdate']), 'posts' => $row['user_posts'], 'warnings' => (isset($row['user_warnings'])) ? $row['user_warnings'] : 0, - 'from' => (!empty($row['user_from'])) ? $row['user_from'] : '', 'sig' => $user_sig, 'sig_bbcode_uid' => (!empty($row['user_sig_bbcode_uid'])) ? $row['user_sig_bbcode_uid'] : '', @@ -1617,7 +1615,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'RANK_IMG_SRC' => $user_cache[$poster_id]['rank_image_src'], 'POSTER_JOINED' => $user_cache[$poster_id]['joined'], 'POSTER_POSTS' => $user_cache[$poster_id]['posts'], - 'POSTER_FROM' => $user_cache[$poster_id]['from'], 'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'], 'POSTER_WARNINGS' => $user_cache[$poster_id]['warnings'], 'POSTER_AGE' => $user_cache[$poster_id]['age'], diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php index ad4171cd81..ac5377f2f6 100644 --- a/tests/auth/provider_apache_test.php +++ b/tests/auth/provider_apache_test.php @@ -193,7 +193,6 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case 'user_sig' => '', 'user_sig_bbcode_uid' => '', 'user_sig_bbcode_bitfield' => '', - 'user_from' => '', 'user_icq' => '', 'user_aim' => '', 'user_yim' => '', |