mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/12733] Add Twitter custom profile field
PHPBB3-12733
This commit is contained in:
parent
70d4ede9b2
commit
fac6ab1fd4
4 changed files with 63 additions and 0 deletions
|
@ -806,6 +806,7 @@ INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_len
|
||||||
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, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_icq', 'profilefields.type.string', 'phpbb_icq', '20', '3', '15', '', '', '[0-9]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 6, 1, 'SEND_ICQ_MESSAGE', 'https://www.icq.com/people/%s/');
|
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, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_icq', 'profilefields.type.string', 'phpbb_icq', '20', '3', '15', '', '', '[0-9]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 6, 1, 'SEND_ICQ_MESSAGE', 'https://www.icq.com/people/%s/');
|
||||||
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, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_wlm', 'profilefields.type.string', 'phpbb_wlm', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 7, 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, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_wlm', 'profilefields.type.string', 'phpbb_wlm', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 7, 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, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_yahoo', 'profilefields.type.string', 'phpbb_yahoo', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 8, 1, 'SEND_YIM_MESSAGE', 'http://edit.yahoo.com/config/send_webmesg?.target=%s&.src=pg');
|
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, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_yahoo', 'profilefields.type.string', 'phpbb_yahoo', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 8, 1, 'SEND_YIM_MESSAGE', 'http://edit.yahoo.com/config/send_webmesg?.target=%s&.src=pg');
|
||||||
|
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, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_twitter', 'profilefields.type.string', 'phpbb_twitter', '20', '1', '15', '', '', '[\\w_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 10, 1, 'VIEW_TWITTER_PROFILE', 'http://twitter.com/%s');
|
||||||
|
|
||||||
# User Notification Options (for first user)
|
# User Notification Options (for first user)
|
||||||
INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('post', 0, 2, '');
|
INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('post', 0, 2, '');
|
||||||
|
|
|
@ -771,6 +771,7 @@ $lang = array_merge($lang, array(
|
||||||
2 => 'Total members <strong>%d</strong>',
|
2 => 'Total members <strong>%d</strong>',
|
||||||
),
|
),
|
||||||
'TRACKED_PHP_ERROR' => 'Tracked PHP errors: %s',
|
'TRACKED_PHP_ERROR' => 'Tracked PHP errors: %s',
|
||||||
|
'TWITTER' => 'Twitter',
|
||||||
|
|
||||||
'UNABLE_GET_IMAGE_SIZE' => 'It was not possible to determine the dimensions of the image. Please verify that the URL you entered is correct.',
|
'UNABLE_GET_IMAGE_SIZE' => 'It was not possible to determine the dimensions of the image. Please verify that the URL you entered is correct.',
|
||||||
'UNABLE_TO_DELIVER_FILE'=> 'Unable to deliver file.',
|
'UNABLE_TO_DELIVER_FILE'=> 'Unable to deliver file.',
|
||||||
|
|
|
@ -144,4 +144,5 @@ $lang = array_merge($lang, array(
|
||||||
'USERS_PER_PAGE' => 'Users per page',
|
'USERS_PER_PAGE' => 'Users per page',
|
||||||
|
|
||||||
'VIEWING_PROFILE' => 'Viewing profile - %s',
|
'VIEWING_PROFILE' => 'Viewing profile - %s',
|
||||||
|
'VIEW_TWITTER_PROFILE' => 'View Twitter Profile',
|
||||||
));
|
));
|
||||||
|
|
60
phpBB/phpbb/db/migration/data/v310/profilefield_twitter.php
Normal file
60
phpBB/phpbb/db/migration/data/v310/profilefield_twitter.php
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* This file is part of the phpBB Forum Software package.
|
||||||
|
*
|
||||||
|
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||||
|
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||||
|
*
|
||||||
|
* For full copyright and license information, please see
|
||||||
|
* the docs/CREDITS.txt file.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace phpbb\db\migration\data\v310;
|
||||||
|
|
||||||
|
class profilefield_twitter 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_show_novalue',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update_data()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array('custom', array(array($this, 'create_custom_field'))),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected $profilefield_name = 'phpbb_twitter';
|
||||||
|
|
||||||
|
protected $profilefield_database_type = array('VCHAR', '');
|
||||||
|
|
||||||
|
protected $profilefield_data = array(
|
||||||
|
'field_name' => 'phpbb_twitter',
|
||||||
|
'field_type' => 'profilefields.type.string',
|
||||||
|
'field_ident' => 'phpbb_twitter',
|
||||||
|
'field_length' => '20',
|
||||||
|
'field_minlen' => '1',
|
||||||
|
'field_maxlen' => '15',
|
||||||
|
'field_novalue' => '',
|
||||||
|
'field_default_value' => '',
|
||||||
|
'field_validation' => '[\w_]+',
|
||||||
|
'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,
|
||||||
|
'field_is_contact' => 1,
|
||||||
|
'field_contact_desc' => 'VIEW_TWITTER_PROFILE',
|
||||||
|
'field_contact_url' => 'http://twitter.com/%s',
|
||||||
|
);
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue