From 3cebb18ce8e8e97a6b95b32dbab5740489c840ea Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Wed, 18 Jun 2014 19:34:14 +0530 Subject: [ticket/12730] Add Google+ profile field type Google+ has a "+" before a custom URL but doesn't for those which are using their integer ID. To cover that we need to have an extra profile field PHPBB3-12730 --- phpBB/phpbb/profilefields/type/type_googleplus.php | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 phpBB/phpbb/profilefields/type/type_googleplus.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php new file mode 100644 index 0000000000..1bdb04e859 --- /dev/null +++ b/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -0,0 +1,56 @@ + + * @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\profilefields\type; + +class type_googleplus extends type_string +{ + /** + * {@inheritDoc} + */ + public function get_name_short() + { + return 'googleplus'; + } + + /** + * {@inheritDoc} + */ + public function get_default_option_values() + { + return array( + 'field_length' => 20, + 'field_minlen' => 3, + 'field_maxlen' => '', + 'field_validation' => '[\w]+', + 'field_novalue' => '', + 'field_default_value' => '', + ); + } + + /** + * {@inheritDoc} + */ + public function get_profile_contact_value($field_value, $field_data) + { + if (!$field_value && !$field_data['field_show_novalue']) + { + return null; + } + + if (!is_numeric($field_value)) + $field_value = '+' . $field_value; + + return $field_value; + } +} -- cgit v1.2.1 From ab83995f4493f78aec3d3281650c0f9d8bb74843 Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Wed, 18 Jun 2014 19:36:14 +0530 Subject: [ticket/12730] Add a Google+ field by default PHPBB3-12730 --- .../data/v310/profilefield_googleplus.php | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php b/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php new file mode 100644 index 0000000000..8f9a9ed32f --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php @@ -0,0 +1,60 @@ + +* @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_googleplus 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_googleplus'; + + protected $profilefield_database_type = array('VCHAR', ''); + + protected $profilefield_data = array( + 'field_name' => 'phpbb_googleplus', + 'field_type' => 'profilefields.type.googleplus', + 'field_ident' => 'phpbb_googleplus', + 'field_length' => '20', + 'field_minlen' => '3', + 'field_maxlen' => '', + '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_GOOGLEPLUS_PROFILE', + 'field_contact_url' => 'http://plus.google.com/%s', + ); +} \ No newline at end of file -- cgit v1.2.1 From 0e04748d7ff2ea7ab11f5b0d9761a54b5e8ebae4 Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Wed, 18 Jun 2014 19:44:21 +0530 Subject: [ticket/12730] Spaces in block header PHPBB3-12730 --- phpBB/phpbb/profilefields/type/type_googleplus.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php index 1bdb04e859..42a34f1a8a 100644 --- a/phpBB/phpbb/profilefields/type/type_googleplus.php +++ b/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -1,15 +1,15 @@ - * @license GNU General Public License, version 2 (GPL-2.0) - * - * For full copyright and license information, please see - * the docs/CREDITS.txt file. - * - */ +* +* This file is part of the phpBB Forum Software package. +* +* @copyright (c) phpBB Limited +* @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\profilefields\type; -- cgit v1.2.1 From d15706bff55cb828eb0972d421bb15d042350652 Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Wed, 18 Jun 2014 19:53:43 +0530 Subject: [ticket/12730] Incorrect indentation for type_googleplus PHPBB3-12730 --- phpBB/phpbb/profilefields/type/type_googleplus.php | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php index 42a34f1a8a..6611f9811d 100644 --- a/phpBB/phpbb/profilefields/type/type_googleplus.php +++ b/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -15,28 +15,28 @@ namespace phpbb\profilefields\type; class type_googleplus extends type_string { - /** - * {@inheritDoc} - */ - public function get_name_short() - { - return 'googleplus'; - } + /** + * {@inheritDoc} + */ + public function get_name_short() + { + return 'googleplus'; + } - /** - * {@inheritDoc} - */ - public function get_default_option_values() - { - return array( - 'field_length' => 20, - 'field_minlen' => 3, - 'field_maxlen' => '', - 'field_validation' => '[\w]+', - 'field_novalue' => '', - 'field_default_value' => '', - ); - } + /** + * {@inheritDoc} + */ + public function get_default_option_values() + { + return array( + 'field_length' => 20, + 'field_minlen' => 3, + 'field_maxlen' => '', + 'field_validation' => '[\w]+', + 'field_novalue' => '', + 'field_default_value' => '', + ); + } /** * {@inheritDoc} -- cgit v1.2.1 From e1454ec4872e22d9a3fe6e9a147d9926212c11b7 Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Thu, 19 Jun 2014 03:45:51 +0530 Subject: [ticket/12730] Minor formatting fixes PHPBB3-12730 --- .../phpbb/db/migration/data/v310/profilefield_googleplus.php | 2 +- phpBB/phpbb/profilefields/type/type_googleplus.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php b/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php index 8f9a9ed32f..bba20d117b 100644 --- a/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php +++ b/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php @@ -57,4 +57,4 @@ class profilefield_googleplus extends \phpbb\db\migration\profilefield_base_migr 'field_contact_desc' => 'VIEW_GOOGLEPLUS_PROFILE', 'field_contact_url' => 'http://plus.google.com/%s', ); -} \ No newline at end of file +} diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php index 6611f9811d..aec37dffe9 100644 --- a/phpBB/phpbb/profilefields/type/type_googleplus.php +++ b/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -16,16 +16,16 @@ namespace phpbb\profilefields\type; class type_googleplus extends type_string { /** - * {@inheritDoc} - */ + * {@inheritDoc} + */ public function get_name_short() { return 'googleplus'; } /** - * {@inheritDoc} - */ + * {@inheritDoc} + */ public function get_default_option_values() { return array( @@ -39,8 +39,8 @@ class type_googleplus extends type_string } /** - * {@inheritDoc} - */ + * {@inheritDoc} + */ public function get_profile_contact_value($field_value, $field_data) { if (!$field_value && !$field_data['field_show_novalue']) -- cgit v1.2.1 From 1363dccf12c66e525cd61f98e417e3957fc05319 Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Thu, 19 Jun 2014 03:47:26 +0530 Subject: [ticket/12730] Use string template for Google+ CPF instead of a new one PHPBB3-12730 --- phpBB/phpbb/profilefields/type/type_googleplus.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php index aec37dffe9..a58aa6a97f 100644 --- a/phpBB/phpbb/profilefields/type/type_googleplus.php +++ b/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -53,4 +53,12 @@ class type_googleplus extends type_string return $field_value; } + + /** + * {@inheritDoc} + */ + public function get_template_filename() + { + return 'profilefields/string.html'; + } } -- cgit v1.2.1 From 474dc577822e8c1937b35040de563cc81f0867cf Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Fri, 20 Jun 2014 17:24:03 +0530 Subject: [ticket/12730] Add missing brackets to type_googleplus.php PHPBB3-12730 --- phpBB/phpbb/profilefields/type/type_googleplus.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php index a58aa6a97f..32c3e77f12 100644 --- a/phpBB/phpbb/profilefields/type/type_googleplus.php +++ b/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -49,7 +49,9 @@ class type_googleplus extends type_string } if (!is_numeric($field_value)) + { $field_value = '+' . $field_value; + } return $field_value; } -- cgit v1.2.1 From 83966a575bfac025bd74e193abad3ceade92b4ae Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Sat, 21 Jun 2014 01:36:01 +0530 Subject: [ticket/12730] Restore field_length to 10 for type_googleplus PHPBB3-12730 --- phpBB/phpbb/profilefields/type/type_googleplus.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php index 32c3e77f12..37ec0dd999 100644 --- a/phpBB/phpbb/profilefields/type/type_googleplus.php +++ b/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -29,11 +29,11 @@ class type_googleplus extends type_string public function get_default_option_values() { return array( - 'field_length' => 20, - 'field_minlen' => 3, - 'field_maxlen' => '', - 'field_validation' => '[\w]+', - 'field_novalue' => '', + 'field_length' => 10, + 'field_minlen' => 3, + 'field_maxlen' => '', + 'field_validation' => '[\w]+', + 'field_novalue' => '', 'field_default_value' => '', ); } -- cgit v1.2.1 From 985dbd448272315e75a071d628209852a62a19c8 Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Sat, 21 Jun 2014 01:54:15 +0530 Subject: [ticket/12730] Switch service name to googleplus for type_googleplus PHPBB3-12730 --- phpBB/phpbb/profilefields/type/type_googleplus.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php index 37ec0dd999..49fa557fab 100644 --- a/phpBB/phpbb/profilefields/type/type_googleplus.php +++ b/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -18,9 +18,9 @@ class type_googleplus extends type_string /** * {@inheritDoc} */ - public function get_name_short() + public function get_service_name() { - return 'googleplus'; + return 'profilefields.type.googleplus'; } /** @@ -55,12 +55,4 @@ class type_googleplus extends type_string return $field_value; } - - /** - * {@inheritDoc} - */ - public function get_template_filename() - { - return 'profilefields/string.html'; - } } -- cgit v1.2.1 From 72f3ff2dcc9f2bdfe161f6bfb6383680125b9bf2 Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Sat, 21 Jun 2014 03:48:23 +0530 Subject: [ticket/12730] Update field_length to be 20 by default for Google+ PHPBB3-12730 --- phpBB/phpbb/profilefields/type/type_googleplus.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php index 49fa557fab..e7896abc5d 100644 --- a/phpBB/phpbb/profilefields/type/type_googleplus.php +++ b/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -29,7 +29,7 @@ class type_googleplus extends type_string public function get_default_option_values() { return array( - 'field_length' => 10, + 'field_length' => 20, 'field_minlen' => 3, 'field_maxlen' => '', 'field_validation' => '[\w]+', -- cgit v1.2.1 From e51a5791dd66870ae056394efca759338dd4d9c4 Mon Sep 17 00:00:00 2001 From: Shitiz Garg Date: Sat, 21 Jun 2014 03:51:08 +0530 Subject: [ticket/12730] Update maxlen for type_googleplus to 255 PHPBB3-12730 --- phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php | 2 +- phpBB/phpbb/profilefields/type/type_googleplus.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php b/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php index bba20d117b..9bef0a4c0b 100644 --- a/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php +++ b/phpBB/phpbb/db/migration/data/v310/profilefield_googleplus.php @@ -40,7 +40,7 @@ class profilefield_googleplus extends \phpbb\db\migration\profilefield_base_migr 'field_ident' => 'phpbb_googleplus', 'field_length' => '20', 'field_minlen' => '3', - 'field_maxlen' => '', + 'field_maxlen' => '255', 'field_novalue' => '', 'field_default_value' => '', 'field_validation' => '[\w]+', diff --git a/phpBB/phpbb/profilefields/type/type_googleplus.php b/phpBB/phpbb/profilefields/type/type_googleplus.php index e7896abc5d..df1bcc7f4b 100644 --- a/phpBB/phpbb/profilefields/type/type_googleplus.php +++ b/phpBB/phpbb/profilefields/type/type_googleplus.php @@ -31,7 +31,7 @@ class type_googleplus extends type_string return array( 'field_length' => 20, 'field_minlen' => 3, - 'field_maxlen' => '', + 'field_maxlen' => 255, 'field_validation' => '[\w]+', 'field_novalue' => '', 'field_default_value' => '', -- cgit v1.2.1