1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 04:30:29 +01:00

[ticket/12187] Convert website field data to custom profile field

PHPBB3-12187
This commit is contained in:
Joas Schilling 2014-03-03 12:38:55 +01:00
parent a2f2629e2a
commit e750d71f84
10 changed files with 64 additions and 4 deletions

View File

@ -795,6 +795,7 @@ $schema_data['phpbb_profile_fields_data'] = array(
'pf_phpbb_interests' => array('TEXT_UNI', ''),
'pf_phpbb_occupation' => array('TEXT_UNI', ''),
'pf_phpbb_icq' => array('VCHAR', ''),
'pf_phpbb_website' => array('VCHAR', ''),
),
'PRIMARY_KEY' => 'user_id',
);

View File

@ -906,7 +906,6 @@ if (!$get_info)
array('user_inactive_reason', '', 'phpbb_inactive_reason'),
array('user_inactive_time', '', 'phpbb_inactive_time'),
array('user_website', 'users.user_website', 'validate_website'),
array('user_jabber', '', ''),
array('user_msnm', 'users.user_msnm', array('function1' => 'phpbb_set_encoding')),
array('user_yim', 'users.user_yim', array('function1' => 'phpbb_set_encoding')),
@ -963,6 +962,7 @@ if (!$get_info)
array('pf_phpbb_interests', 'users.user_interests', array('function1' => 'phpbb_set_encoding')),
array('pf_phpbb_location', 'users.user_from', array('function1' => 'phpbb_set_encoding')),
array('pf_phpbb_icq', 'users.user_icq', array('function1' => 'phpbb_set_encoding')),
array('pf_phpbb_website', 'users.user_website', 'validate_website'),
'where' => 'users.user_id <> -1',
),

View File

@ -954,7 +954,8 @@ CREATE TABLE phpbb_profile_fields_data (
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,
pf_phpbb_icq VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
pf_phpbb_icq VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
pf_phpbb_website VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL
);;
ALTER TABLE phpbb_profile_fields_data ADD PRIMARY KEY (user_id);;

View File

@ -1135,7 +1135,7 @@ CREATE TABLE [phpbb_profile_fields] (
[field_order] [int] DEFAULT (0) NOT NULL ,
[field_is_contact] [int] DEFAULT (0) NOT NULL ,
[field_contact_desc] [varchar] (255) DEFAULT ('') NOT NULL ,
[field_contact_url] [varchar] (255) DEFAULT ('') NOT NULL
[field_contact_url] [varchar] (255) DEFAULT ('') NOT NULL
) ON [PRIMARY]
GO
@ -1161,7 +1161,8 @@ CREATE TABLE [phpbb_profile_fields_data] (
[pf_phpbb_location] [varchar] (255) DEFAULT ('') NOT NULL ,
[pf_phpbb_interests] [varchar] (4000) DEFAULT ('') NOT NULL ,
[pf_phpbb_occupation] [varchar] (4000) DEFAULT ('') NOT NULL ,
[pf_phpbb_icq] [varchar] (255) DEFAULT ('') NOT NULL
[pf_phpbb_icq] [varchar] (255) DEFAULT ('') NOT NULL ,
[pf_phpbb_website] [varchar] (255) DEFAULT ('') NOT NULL
) ON [PRIMARY]
GO

View File

@ -680,6 +680,7 @@ CREATE TABLE phpbb_profile_fields_data (
pf_phpbb_interests blob NOT NULL,
pf_phpbb_occupation blob NOT NULL,
pf_phpbb_icq varbinary(255) DEFAULT '' NOT NULL,
pf_phpbb_website varbinary(255) DEFAULT '' NOT NULL,
PRIMARY KEY (user_id)
);

View File

@ -680,6 +680,7 @@ CREATE TABLE phpbb_profile_fields_data (
pf_phpbb_interests text NOT NULL,
pf_phpbb_occupation text NOT NULL,
pf_phpbb_icq varchar(255) DEFAULT '' NOT NULL,
pf_phpbb_website varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (user_id)
) CHARACTER SET `utf8` COLLATE `utf8_bin`;

View File

@ -1273,6 +1273,7 @@ CREATE TABLE phpbb_profile_fields_data (
pf_phpbb_interests clob DEFAULT '' ,
pf_phpbb_occupation clob DEFAULT '' ,
pf_phpbb_icq varchar2(255) DEFAULT '' ,
pf_phpbb_website varchar2(255) DEFAULT '' ,
CONSTRAINT pk_phpbb_profile_fields_data PRIMARY KEY (user_id)
)
/

View File

@ -890,6 +890,7 @@ CREATE TABLE phpbb_profile_fields_data (
pf_phpbb_interests varchar(4000) DEFAULT '' NOT NULL,
pf_phpbb_occupation varchar(4000) DEFAULT '' NOT NULL,
pf_phpbb_icq varchar(255) DEFAULT '' NOT NULL,
pf_phpbb_website varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (user_id)
);

View File

@ -660,6 +660,7 @@ CREATE TABLE phpbb_profile_fields_data (
pf_phpbb_interests text(65535) NOT NULL DEFAULT '',
pf_phpbb_occupation text(65535) NOT NULL DEFAULT '',
pf_phpbb_icq varchar(255) NOT NULL DEFAULT '',
pf_phpbb_website varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (user_id)
);

View File

@ -0,0 +1,52 @@
<?php
/**
*
* @package migration
* @copyright (c) 2014 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
namespace phpbb\db\migration\data\v310;
class profilefield_website extends \phpbb\db\migration\profilefield_base_migration
{
static public function depends_on()
{
return array(
'\phpbb\db\migration\data\v310\profilefield_on_memberlist',
'\phpbb\db\migration\data\v310\profilefield_icq_cleanup',
);
}
protected $profilefield_name = 'phpbb_website';
protected $profilefield_database_type = array('VCHAR', '');
protected $profilefield_data = array(
'field_name' => 'phpbb_website',
'field_type' => 'profilefields.type.url',
'field_ident' => 'phpbb_website',
'field_length' => '40',
'field_minlen' => '12',
'field_maxlen' => '255',
'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_on_ml' => 1,
'field_show_profile' => 1,
'field_hide' => 0,
'field_no_view' => 0,
'field_active' => 1,
'field_is_contact' => 1,
'field_contact_desc' => 'VISIT_WEBSITE',
'field_contact_url' => '%s',
);
protected $user_column_name = 'user_website';
}