diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-06-20 23:36:26 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-06-20 23:36:26 +0200 |
commit | 8595fee0401c66511d508fd2d2f0a69609ce5770 (patch) | |
tree | 87be100e0a750035d8df999e4d457f9f2efb0f81 /phpBB/phpbb | |
parent | a5ca7479b24a1e7ba954f13c80f26d466b80237e (diff) | |
parent | aeeaf2f6efc79ca407cf8872b1538902b93c2236 (diff) | |
download | forums-8595fee0401c66511d508fd2d2f0a69609ce5770.tar forums-8595fee0401c66511d508fd2d2f0a69609ce5770.tar.gz forums-8595fee0401c66511d508fd2d2f0a69609ce5770.tar.bz2 forums-8595fee0401c66511d508fd2d2f0a69609ce5770.tar.xz forums-8595fee0401c66511d508fd2d2f0a69609ce5770.zip |
Merge pull request #2611 from Dragooon/ticket/12729
[ticket/12729] Add Facebook custom profile field
* Dragooon/ticket/12729:
[ticket/12729] Add functional test for Facebook field
[ticket/12730] Values needn't be escaped for schema_data.sql
[ticket/12729] Set field_active as 1 for Facebook profile field
[ticket/12729] Add unit test for ALPHA_DOTS validation
[ticket/12729] Move ALPHA_DOTS to above ALPHA_SPACERS
[ticket/12729] Convert spaces to tabs
[ticket/12729] Fix block header spacing for profilefield_facebook.php
[ticket/12729] Update schema.json
[ticket/12729] Unnecessary whitespace in profilefield_facebook.php
[ticket/12729] Cleanup schema_data.sql for Facebook field
[ticket/12729] Add Facebook custom profile field
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php | 60 | ||||
-rw-r--r-- | phpBB/phpbb/profilefields/type/type_string_common.php | 1 |
2 files changed, 61 insertions, 0 deletions
diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php b/phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php new file mode 100644 index 0000000000..5964e7a997 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/profilefield_facebook.php @@ -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_facebook 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_facebook'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_facebook', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_facebook', + 'field_length' => '20', + 'field_minlen' => '5', + 'field_maxlen' => '50', + '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_FACEBOOK_PROFILE', + 'field_contact_url' => 'http://facebook.com/%s/', + ); +} diff --git a/phpBB/phpbb/profilefields/type/type_string_common.php b/phpBB/phpbb/profilefields/type/type_string_common.php index 7d0cb04d7c..91198deec0 100644 --- a/phpBB/phpbb/profilefields/type/type_string_common.php +++ b/phpBB/phpbb/profilefields/type/type_string_common.php @@ -20,6 +20,7 @@ abstract class type_string_common extends type_base 'NUMBERS_ONLY' => '[0-9]+', 'ALPHA_ONLY' => '[\w]+', 'ALPHA_UNDERSCORE' => '[\w_]+', + 'ALPHA_DOTS' => '[\w.]+', 'ALPHA_SPACERS' => '[\w_\+\. \-\[\]]+', ); |