From e7321c9e559919f0e5da677ecf6ba6518f433b4c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 16 May 2015 18:07:08 +0200 Subject: [PATCH 1/9] [ticket/13844] Add a little develop script to migrate the files PHPBB3-13844 --- phpBB/develop/lang_migrate_help_lang.php | 312 +++++++++++++++++++++++ 1 file changed, 312 insertions(+) create mode 100644 phpBB/develop/lang_migrate_help_lang.php diff --git a/phpBB/develop/lang_migrate_help_lang.php b/phpBB/develop/lang_migrate_help_lang.php new file mode 100644 index 0000000000..28a8ee058b --- /dev/null +++ b/phpBB/develop/lang_migrate_help_lang.php @@ -0,0 +1,312 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +// +// Security message: +// +// This script is potentially dangerous. +// Remove or comment the next line (die(".... ) to enable this script. +// Do NOT FORGET to either remove this script or disable it after you have used it. +// +#die("Please read the first lines of this script for instructions on how to enable it"); + +define('IN_PHPBB', true); +$phpEx = substr(strrchr(__FILE__, '.'), 1); +$phpbb_root_path='./../'; +include($phpbb_root_path . 'common.'.$phpEx); + +$help_bbcode = load_help('bbcode'); +$lang_bbcode = array( + 'HELP_BBCODE_BLOCK_INTRO' => $help_bbcode[0][1], + 'HELP_BBCODE_INTRO_BBCODE_QUESTION' => $help_bbcode[1][0], + 'HELP_BBCODE_INTRO_BBCODE_ANSWER' => $help_bbcode[1][1], + + 'HELP_BBCODE_BLOCK_TEXT' => $help_bbcode[2][1], + 'HELP_BBCODE_TEXT_BASIC_QUESTION' => $help_bbcode[3][0], + 'HELP_BBCODE_TEXT_BASIC_ANSWER' => $help_bbcode[3][1], + 'HELP_BBCODE_TEXT_COLOR_QUESTION' => $help_bbcode[4][0], + 'HELP_BBCODE_TEXT_COLOR_ANSWER' => $help_bbcode[4][1], + 'HELP_BBCODE_TEXT_COMBINE_QUESTION' => $help_bbcode[5][0], + 'HELP_BBCODE_TEXT_COMBINE_ANSWER' => $help_bbcode[5][1], + + 'HELP_BBCODE_BLOCK_QUOTES' => $help_bbcode[6][1], + 'HELP_BBCODE_QUOTES_TEXT_QUESTION' => $help_bbcode[7][0], + 'HELP_BBCODE_QUOTES_TEXT_ANSWER' => $help_bbcode[7][1], + 'HELP_BBCODE_QUOTES_CODE_QUESTION' => $help_bbcode[8][0], + 'HELP_BBCODE_QUOTES_CODE_ANSWER' => $help_bbcode[8][1], + + 'HELP_BBCODE_BLOCK_LISTS' => $help_bbcode[9][1], + 'HELP_BBCODE_LISTS_UNORDERER_QUESTION' => $help_bbcode[10][0], + 'HELP_BBCODE_LISTS_UNORDERER_ANSWER' => $help_bbcode[10][1], + 'HELP_BBCODE_LISTS_ORDERER_QUESTION' => $help_bbcode[11][0], + 'HELP_BBCODE_LISTS_ORDERER_ANSWER' => $help_bbcode[11][1], + + 'HELP_BBCODE_BLOCK_LINKS' => $help_bbcode[13][1], + 'HELP_BBCODE_LINKS_BASIC_QUESTION' => $help_bbcode[14][0], + 'HELP_BBCODE_LINKS_BASIC_ANSWER' => $help_bbcode[14][1], + + 'HELP_BBCODE_BLOCK_IMAGES' => $help_bbcode[15][1], + 'HELP_BBCODE_IMAGES_BASIC_QUESTION' => $help_bbcode[16][0], + 'HELP_BBCODE_IMAGES_BASIC_ANSWER' => $help_bbcode[16][1], + 'HELP_BBCODE_IMAGES_ATTACHMENT_QUESTION' => $help_bbcode[17][0], + 'HELP_BBCODE_IMAGES_ATTACHMENT_ANSWER' => $help_bbcode[17][1], + + 'HELP_BBCODE_BLOCK_OTHERS' => $help_bbcode[18][1], + 'HELP_BBCODE_OTHERS_CUSTOM_QUESTION' => $help_bbcode[19][0], + 'HELP_BBCODE_OTHERS_CUSTOM_ANSWER' => $help_bbcode[19][1], +); +write_help('bbcode', $lang_bbcode); + +$help_phpbb = load_help('faq'); +$lang_phpbb = array( + 'HELP_FAQ_BLOCK_LOGIN' => $help_phpbb[0][1], + 'HELP_FAQ_LOGIN_REGISTER_QUESTION' => $help_phpbb[1][0], + 'HELP_FAQ_LOGIN_REGISTER_ANSWER' => $help_phpbb[1][1], + 'HELP_FAQ_LOGIN_COPPA_QUESTION' => $help_phpbb[2][0], + 'HELP_FAQ_LOGIN_COPPA_ANSWER' => $help_phpbb[2][1], + 'HELP_FAQ_LOGIN_CANNOT_REGISTER_QUESTION' => $help_phpbb[3][0], + 'HELP_FAQ_LOGIN_CANNOT_REGISTER_ANSWER' => $help_phpbb[3][1], + 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_QUESTION' => $help_phpbb[4][0], + 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_ANSWER' => $help_phpbb[4][1], + 'HELP_FAQ_LOGIN_CANNOT_LOGIN_QUESTION' => $help_phpbb[5][0], + 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANSWER' => $help_phpbb[5][1], + 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_QUESTION' => $help_phpbb[6][0], + 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_ANSWER' => $help_phpbb[6][1], + 'HELP_FAQ_LOGIN_LOST_PASSWORD_QUESTION' => $help_phpbb[7][0], + 'HELP_FAQ_LOGIN_LOST_PASSWORD_ANSWER' => $help_phpbb[7][1], + 'HELP_FAQ_LOGIN_AUTO_LOGOUT_QUESTION' => $help_phpbb[8][0], + 'HELP_FAQ_LOGIN_AUTO_LOGOUT_ANSWER' => $help_phpbb[8][1], + 'HELP_FAQ_LOGIN_DELETE_COOKIES_QUESTION' => $help_phpbb[9][0], + 'HELP_FAQ_LOGIN_DELETE_COOKIES_ANSWER' => $help_phpbb[9][1], + + 'HELP_FAQ_BLOCK_USERSETTINGS' => $help_phpbb[10][1], + 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_QUESTION' => $help_phpbb[11][0], + 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_ANSWER' => $help_phpbb[11][1], + 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_QUESTION' => $help_phpbb[12][0], + 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_ANSWER' => $help_phpbb[12][1], + 'HELP_FAQ_USERSETTINGS_TIMEZONE_QUESTION' => $help_phpbb[13][0], + 'HELP_FAQ_USERSETTINGS_TIMEZONE_ANSWER' => $help_phpbb[13][1], + 'HELP_FAQ_USERSETTINGS_SERVERTIME_QUESTION' => $help_phpbb[14][0], + 'HELP_FAQ_USERSETTINGS_SERVERTIME_ANSWER' => $help_phpbb[14][1], + 'HELP_FAQ_USERSETTINGS_LANGUAGE_QUESTION' => $help_phpbb[15][0], + 'HELP_FAQ_USERSETTINGS_LANGUAGE_ANSWER' => $help_phpbb[15][1], + 'HELP_FAQ_USERSETTINGS_AVATAR_QUESTION' => $help_phpbb[16][0], + 'HELP_FAQ_USERSETTINGS_AVATAR_ANSWER' => $help_phpbb[16][1], + 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_QUESTION' => $help_phpbb[17][0], + 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_ANSWER' => $help_phpbb[17][1], + 'HELP_FAQ_USERSETTINGS_RANK_QUESTION' => $help_phpbb[18][0], + 'HELP_FAQ_USERSETTINGS_RANK_ANSWER' => $help_phpbb[18][1], + 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_QUESTION' => $help_phpbb[19][0], + 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_ANSWER' => $help_phpbb[19][1], + + 'HELP_FAQ_BLOCK_POSTING' => $help_phpbb[20][1], + 'HELP_FAQ_POSTING_CREATE_QUESTION' => $help_phpbb[21][0], + 'HELP_FAQ_POSTING_CREATE_ANSWER' => $help_phpbb[21][1], + 'HELP_FAQ_POSTING_EDIT_DELETE_QUESTION' => $help_phpbb[22][0], + 'HELP_FAQ_POSTING_EDIT_DELETE_ANSWER' => $help_phpbb[22][1], + 'HELP_FAQ_POSTING_SIGNATURE_QUESTION' => $help_phpbb[23][0], + 'HELP_FAQ_POSTING_SIGNATURE_ANSWER' => $help_phpbb[23][1], + 'HELP_FAQ_POSTING_POLL_CREATE_QUESTION' => $help_phpbb[24][0], + 'HELP_FAQ_POSTING_POLL_CREATE_ANSWER' => $help_phpbb[24][1], + 'HELP_FAQ_POSTING_POLL_ADD_QUESTION' => $help_phpbb[25][0], + 'HELP_FAQ_POSTING_POLL_ADD_ANSWER' => $help_phpbb[25][1], + 'HELP_FAQ_POSTING_POLL_EDIT_QUESTION' => $help_phpbb[26][0], + 'HELP_FAQ_POSTING_POLL_EDIT_ANSWER' => $help_phpbb[26][1], + 'HELP_FAQ_POSTING_FORUM_RESTRICTED_QUESTION' => $help_phpbb[27][0], + 'HELP_FAQ_POSTING_FORUM_RESTRICTED_ANSWER' => $help_phpbb[27][1], + 'HELP_FAQ_POSTING_NO_ATTACHMENTS_QUESTION' => $help_phpbb[28][0], + 'HELP_FAQ_POSTING_NO_ATTACHMENTS_ANSWER' => $help_phpbb[28][1], + 'HELP_FAQ_POSTING_WARNING_QUESTION' => $help_phpbb[29][0], + 'HELP_FAQ_POSTING_WARNING_ANSWER' => $help_phpbb[29][1], + 'HELP_FAQ_POSTING_REPORT_QUESTION' => $help_phpbb[30][0], + 'HELP_FAQ_POSTING_REPORT_ANSWER' => $help_phpbb[30][1], + 'HELP_FAQ_POSTING_DRAFT_QUESTION' => $help_phpbb[31][0], + 'HELP_FAQ_POSTING_DRAFT_ANSWER' => $help_phpbb[31][1], + 'HELP_FAQ_POSTING_QUEUE_QUESTION' => $help_phpbb[32][0], + 'HELP_FAQ_POSTING_QUEUE_ANSWER' => $help_phpbb[32][1], + 'HELP_FAQ_POSTING_BUMP_QUESTION' => $help_phpbb[33][0], + 'HELP_FAQ_POSTING_BUMP_ANSWER' => $help_phpbb[33][1], + + 'HELP_FAQ_BLOCK_FORMATTING' => $help_phpbb[34][1], + 'HELP_FAQ_FORMATTING_BBOCDE_QUESTION' => $help_phpbb[35][0], + 'HELP_FAQ_FORMATTING_BBOCDE_ANSWER' => $help_phpbb[35][1], + 'HELP_FAQ_FORMATTING_HTML_QUESTION' => $help_phpbb[36][0], + 'HELP_FAQ_FORMATTING_HTML_ANSWER' => $help_phpbb[36][1], + 'HELP_FAQ_FORMATTING_SMILIES_QUESTION' => $help_phpbb[37][0], + 'HELP_FAQ_FORMATTING_SMILIES_ANSWER' => $help_phpbb[37][1], + 'HELP_FAQ_FORMATTING_IMAGES_QUESTION' => $help_phpbb[38][0], + 'HELP_FAQ_FORMATTING_IMAGES_ANSWER' => $help_phpbb[38][1], + 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_QUESTION' => $help_phpbb[39][0], + 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_ANSWER' => $help_phpbb[39][1], + 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_QUESTION' => $help_phpbb[40][0], + 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_ANSWER' => $help_phpbb[40][1], + 'HELP_FAQ_FORMATTING_STICKIES_QUESTION' => $help_phpbb[41][0], + 'HELP_FAQ_FORMATTING_STICKIES_ANSWER' => $help_phpbb[41][1], + 'HELP_FAQ_FORMATTING_LOCKED_QUESTION' => $help_phpbb[42][0], + 'HELP_FAQ_FORMATTING_LOCKED_ANSWER' => $help_phpbb[42][1], + 'HELP_FAQ_FORMATTING_ICONS_QUESTION' => $help_phpbb[43][0], + 'HELP_FAQ_FORMATTING_ICONS_ANSWER' => $help_phpbb[43][1], + + 'HELP_FAQ_BLOCK_GROUPS' => $help_phpbb[45][1], + 'HELP_FAQ_GROUPS_ADMINISTRATORS_QUESTION' => $help_phpbb[46][0], + 'HELP_FAQ_GROUPS_ADMINISTRATORS_ANSWER' => $help_phpbb[46][1], + 'HELP_FAQ_GROUPS_MODERATORS_QUESTION' => $help_phpbb[47][0], + 'HELP_FAQ_GROUPS_MODERATORS_ANSWER' => $help_phpbb[47][1], + 'HELP_FAQ_GROUPS_USERGROUPS_QUESTION' => $help_phpbb[48][0], + 'HELP_FAQ_GROUPS_USERGROUPS_ANSWER' => $help_phpbb[48][1], + 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_QUESTION' => $help_phpbb[49][0], + 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_ANSWER' => $help_phpbb[49][1], + 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_QUESTION' => $help_phpbb[50][0], + 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_ANSWER' => $help_phpbb[50][1], + 'HELP_FAQ_GROUPS_COLORS_QUESTION' => $help_phpbb[51][0], + 'HELP_FAQ_GROUPS_COLORS_ANSWER' => $help_phpbb[51][1], + 'HELP_FAQ_GROUPS_DEFAULT_QUESTION' => $help_phpbb[52][0], + 'HELP_FAQ_GROUPS_DEFAULT_ANSWER' => $help_phpbb[52][1], + 'HELP_FAQ_GROUPS_TEAM_QUESTION' => $help_phpbb[53][0], + 'HELP_FAQ_GROUPS_TEAM_ANSWER' => $help_phpbb[53][1], + + 'HELP_FAQ_BLOCK_PMS' => $help_phpbb[54][1], + 'HELP_FAQ_PMS_CANNOT_SEND_QUESTION' => $help_phpbb[55][0], + 'HELP_FAQ_PMS_CANNOT_SEND_ANSWER' => $help_phpbb[55][1], + 'HELP_FAQ_PMS_UNWANTED_QUESTION' => $help_phpbb[56][0], + 'HELP_FAQ_PMS_UNWANTED_ANSWER' => $help_phpbb[56][1], + 'HELP_FAQ_PMS_SPAM_QUESTION' => $help_phpbb[57][0], + 'HELP_FAQ_PMS_SPAM_ANSWER' => $help_phpbb[57][1], + + 'HELP_FAQ_BLOCK_FRIENDS' => $help_phpbb[58][1], + 'HELP_FAQ_FRIENDS_BASIC_QUESTION' => $help_phpbb[59][0], + 'HELP_FAQ_FRIENDS_BASIC_ANSWER' => $help_phpbb[59][1], + 'HELP_FAQ_FRIENDS_MANAGE_QUESTION' => $help_phpbb[60][0], + 'HELP_FAQ_FRIENDS_MANAGE_ANSWER' => $help_phpbb[60][1], + + 'HELP_FAQ_BLOCK_SEARCH' => $help_phpbb[61][1], + 'HELP_FAQ_SEARCH_FORUM_QUESTION' => $help_phpbb[62][0], + 'HELP_FAQ_SEARCH_FORUM_ANSWER' => $help_phpbb[62][1], + 'HELP_FAQ_SEARCH_NO_RESULT_QUESTION' => $help_phpbb[63][0], + 'HELP_FAQ_SEARCH_NO_RESULT_ANSWER' => $help_phpbb[63][1], + 'HELP_FAQ_SEARCH_BLANK_QUESTION' => $help_phpbb[64][0], + 'HELP_FAQ_SEARCH_BLANK_ANSWER' => $help_phpbb[64][1], + 'HELP_FAQ_SEARCH_MEMBERS_QUESTION' => $help_phpbb[65][0], + 'HELP_FAQ_SEARCH_MEMBERS_ANSWER' => $help_phpbb[65][1], + 'HELP_FAQ_SEARCH_OWN_QUESTION' => $help_phpbb[66][0], + 'HELP_FAQ_SEARCH_OWN_ANSWER' => $help_phpbb[66][1], + + 'HELP_FAQ_BLOCK_BOOKMARKS' => $help_phpbb[67][1], + 'HELP_FAQ_BOOKMARKS_DIFFERENCE_QUESTION' => $help_phpbb[68][0], + 'HELP_FAQ_BOOKMARKS_DIFFERENCE_ANSWER' => $help_phpbb[68][1], + 'HELP_FAQ_BOOKMARKS_TOPIC_QUESTION' => $help_phpbb[69][0], + 'HELP_FAQ_BOOKMARKS_TOPIC_ANSWER' => $help_phpbb[69][1], + 'HELP_FAQ_BOOKMARKS_FORUM_QUESTION' => $help_phpbb[70][0], + 'HELP_FAQ_BOOKMARKS_FORUM_ANSWER' => $help_phpbb[70][1], + 'HELP_FAQ_BOOKMARKS_REMOVE_QUESTION' => $help_phpbb[71][0], + 'HELP_FAQ_BOOKMARKS_REMOVE_ANSWER' => $help_phpbb[71][1], + + 'HELP_FAQ_BLOCK_ATTACHMENTS' => $help_phpbb[72][1], + 'HELP_FAQ_ATTACHMENTS_ALLOWED_QUESTION' => $help_phpbb[73][0], + 'HELP_FAQ_ATTACHMENTS_ALLOWED_ANSWER' => $help_phpbb[73][1], + 'HELP_FAQ_ATTACHMENTS_OWN_QUESTION' => $help_phpbb[74][0], + 'HELP_FAQ_ATTACHMENTS_OWN_ANSWER' => $help_phpbb[74][1], + + 'HELP_FAQ_BLOCK_ISSUES' => $help_phpbb[75][1], + 'HELP_FAQ_ISSUES_WHOIS_PHPBB_QUESTION' => $help_phpbb[76][0], + 'HELP_FAQ_ISSUES_WHOIS_PHPBB_ANSWER' => $help_phpbb[76][1], + 'HELP_FAQ_ISSUES_FEATURE_QUESTION' => $help_phpbb[77][0], + 'HELP_FAQ_ISSUES_FEATURE_ANSWER' => $help_phpbb[77][1], + 'HELP_FAQ_ISSUES_LEGAL_QUESTION' => $help_phpbb[78][0], + 'HELP_FAQ_ISSUES_LEGAL_ANSWER' => $help_phpbb[78][1], + 'HELP_FAQ_ISSUES_ADMIN_QUESTION' => $help_phpbb[79][0], + 'HELP_FAQ_ISSUES_ADMIN_ANSWER' => $help_phpbb[79][1], + +); +write_help('phpbb', $lang_phpbb); + +trigger_error('Successfully migrated help_bbcode and help_faq to help/bbcode and help/phpbb'); + +/** + * @param string $help + * @return array + */ +function load_help($help) +{ + global $phpbb_root_path; + include($phpbb_root_path . 'language/en/help_' . $help . '.php'); + return $help; +} + +/** + * @param string $help + * @param array $lang + */ +function write_help($help, array $lang) +{ + global $phpbb_root_path; + $fp = fopen($phpbb_root_path . 'language/en/help/' . $help . '.php', 'wb'); + fwrite($fp, get_language_file_header()); + fwrite($fp, '$lang = array(' . "\n"); + + $last_key = ''; + ksort($lang); + foreach ($lang as $key => $translation) + { + $key_sections = explode('_', $key, 4); + unset($key_sections[3]); + $key_start = implode('_', $key_sections); + + if ($last_key !== '' && $key_start !== $last_key) + { + fwrite($fp, "\n"); + } + fwrite($fp, "\t'" . $key . "'\t=> '" . $translation . "',\n"); + $last_key = $key_start; + } + + fwrite($fp, ');' . "\n"); + #fwrite($fp, $lang); + fclose($fp); +} + +/** + * @return string + */ +function get_language_file_header() +{ + return << + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +/** + * DO NOT CHANGE + */ +if (!defined('IN_PHPBB')) +{ + exit; +} + +if (empty(\$lang) || !is_array(\$lang)) +{ + \$lang = array(); +} + + +EOT; +} From 5586cbbcfe5117e1750ebff507e42b296c729aa1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 16 May 2015 18:07:35 +0200 Subject: [PATCH 2/9] [ticket/13844] Add new versions of the old help_* files PHPBB3-13844 --- phpBB/language/en/help/bbcode.php | 66 +++++++++++ phpBB/language/en/help/faq.php | 186 ++++++++++++++++++++++++++++++ 2 files changed, 252 insertions(+) create mode 100644 phpBB/language/en/help/bbcode.php create mode 100644 phpBB/language/en/help/faq.php diff --git a/phpBB/language/en/help/bbcode.php b/phpBB/language/en/help/bbcode.php new file mode 100644 index 0000000000..cfbba0b771 --- /dev/null +++ b/phpBB/language/en/help/bbcode.php @@ -0,0 +1,66 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +/** + * DO NOT CHANGE + */ +if (!defined('IN_PHPBB')) +{ + exit; +} + +if (empty($lang) || !is_array($lang)) +{ + $lang = array(); +} + +$lang = array( + 'HELP_BBCODE_BLOCK_IMAGES' => 'Showing images in posts', + 'HELP_BBCODE_BLOCK_INTRO' => 'Introduction', + 'HELP_BBCODE_BLOCK_LINKS' => 'Creating Links', + 'HELP_BBCODE_BLOCK_LISTS' => 'Generating lists', + 'HELP_BBCODE_BLOCK_OTHERS' => 'Other matters', + 'HELP_BBCODE_BLOCK_QUOTES' => 'Quoting and outputting fixed-width text', + 'HELP_BBCODE_BLOCK_TEXT' => 'Text Formatting', + + 'HELP_BBCODE_IMAGES_ATTACHMENT_ANSWER' => 'Attachments can now be placed in any part of a post by using the new [attachment=][/attachment] BBCode, if the attachments functionality has been enabled by a board administrator and if you are given the appropriate permissions to create attachments. Within the posting screen is a drop-down box (respectively a button) for placing attachments inline.', + 'HELP_BBCODE_IMAGES_ATTACHMENT_QUESTION' => 'Adding attachments into a post', + 'HELP_BBCODE_IMAGES_BASIC_ANSWER' => 'phpBB BBCode incorporates a tag for including images in your posts. Two very important things to remember when using this tag are: many users do not appreciate lots of images being shown in posts and secondly the image you display must already be available on the internet (it cannot exist only on your computer for example, unless you run a webserver!). To display an image you must surround the URL pointing to the image with [img][/img] tags. For example:

[img]http://www.phpbb.com/theme/images/logos/blue/160x52.png[/img]

As noted in the URL section above you can wrap an image in a [url][/url] tag if you wish, e.g.

[url=http://www.phpbb.com/][img]http://www.phpbb.com/theme/images/logos/blue/160x52.png[/img][/url]

would generate:

', + 'HELP_BBCODE_IMAGES_BASIC_QUESTION' => 'Adding an image to a post', + + 'HELP_BBCODE_INTRO_BBCODE_ANSWER' => 'BBCode is a special implementation of HTML. Whether you can actually use BBCode in your posts on the forum is determined by the administrator. In addition you can disable BBCode on a per post basis via the posting form. BBCode itself is similar in style to HTML, tags are enclosed in square brackets [ and ] rather than < and > and it offers greater control over what and how something is displayed. Depending on the template you are using you may find adding BBCode to your posts is made much easier through a clickable interface above the message area on the posting form. Even with this you may find the following guide useful.', + 'HELP_BBCODE_INTRO_BBCODE_QUESTION' => 'What is BBCode?', + + 'HELP_BBCODE_LINKS_BASIC_ANSWER' => 'phpBB BBCode supports a number of ways of creating URIs (Uniform Resource Indicators) better known as URLs.
  • The first of these uses the [url=][/url] tag, whatever you type after the = sign will cause the contents of that tag to act as a URL. For example to link to phpBB.com you could use:

    [url=http://www.phpbb.com/]Visit phpBB![/url]

    This would generate the following link, Visit phpBB! Please notice that the link opens in the same window or a new window depending on the users browser preferences.
  • If you want the URL itself displayed as the link you can do this by simply using:

    [url]http://www.phpbb.com/[/url]

    This would generate the following link, http://www.phpbb.com/
  • Additionally, phpBB features something called Magic Links, this will turn any syntactically correct URL into a link without you needing to specify any tags or even the leading http://. For example typing www.phpbb.com into your message will automatically lead to www.phpbb.com being output when you view the message.
  • The same thing applies equally to email addresses, you can either specify an address explicitly for example:

    [email]no.one@domain.adr[/email]

    which will output no.one@domain.adr or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.
As with all the BBCode tags you can wrap URLs around any of the other tags such as [img][/img] (see next entry), [b][/b], etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:

[url=http://www.phpbb.com/][img]http://www.phpbb.com/theme/images/logos/blue/160x52.png[/url][/img]

is not correct which may lead to your post being deleted so take care.', + 'HELP_BBCODE_LINKS_BASIC_QUESTION' => 'Linking to another site', + + 'HELP_BBCODE_LISTS_ORDERER_ANSWER' => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use [list=1][/list] to create a numbered list or alternatively [list=a][/list] for an alphabetical list. As with the unordered list, items are specified using [*]. For example:

[list=1]
[*]Go to the shops
[*]Buy a new computer
[*]Swear at computer when it crashes
[/list]

will generate the following:
  1. Go to the shops
  2. Buy a new computer
  3. Swear at computer when it crashes
Whereas for an alphabetical list you would use:

[list=a]
[*]The first possible answer
[*]The second possible answer
[*]The third possible answer
[/list]

giving
  1. The first possible answer
  2. The second possible answer
  3. The third possible answer
', + 'HELP_BBCODE_LISTS_ORDERER_QUESTION' => 'Creating an Ordered list', + 'HELP_BBCODE_LISTS_UNORDERER_ANSWER' => 'BBCode supports two types of lists, unordered and ordered. They are essentially the same as their HTML equivalents. An unordered list outputs each item in your list sequentially one after the other indenting each with a bullet character. To create an unordered list you use [list][/list] and define each item within the list using [*]. For example to list your favourite colours you could use:

[list]
[*]Red
[*]Blue
[*]Yellow
[/list]

This would generate the following list:
  • Red
  • Blue
  • Yellow
', + 'HELP_BBCODE_LISTS_UNORDERER_QUESTION' => 'Creating an Unordered list', + + 'HELP_BBCODE_OTHERS_CUSTOM_ANSWER' => 'If you are an administrator on this board and have the proper permissions, you can add further BBCodes through the Custom BBCodes section.', + 'HELP_BBCODE_OTHERS_CUSTOM_QUESTION' => 'Can I add my own tags?', + + 'HELP_BBCODE_QUOTES_CODE_ANSWER' => 'If you want to output a piece of code or in fact anything that requires a fixed width, e.g. Courier type font you should enclose the text in [code][/code] tags, e.g.

[code]echo "This is some code";[/code]

All formatting used within [code][/code] tags is retained when you later view it. PHP syntax highlighting can be enabled using [code=php][/code] and is recommended when posting PHP code samples as it improves readability.', + 'HELP_BBCODE_QUOTES_CODE_QUESTION' => 'Outputting code or fixed width data', + 'HELP_BBCODE_QUOTES_TEXT_ANSWER' => 'There are two ways you can quote text, with a reference or without.
  • When you utilise the Quote function to reply to a post on the board you should notice that the post text is added to the message window enclosed in a [quote=""][/quote] block. This method allows you to quote with a reference to a person or whatever else you choose to put! For example to quote a piece of text Mr. Blobby wrote you would enter:

    [quote="Mr. Blobby"]The text Mr. Blobby wrote would go here[/quote]

    The resulting output will automatically add "Mr. Blobby wrote:" before the actual text. Remember you must include the quotation marks "" around the name you are quoting, they are not optional.
  • The second method allows you to blindly quote something. To utilise this enclose the text in [quote][/quote] tags. When you view the message it will simply show the text within a quotation block.
', + 'HELP_BBCODE_QUOTES_TEXT_QUESTION' => 'Quoting text in replies', + + 'HELP_BBCODE_TEXT_BASIC_ANSWER' => 'BBCode includes tags to allow you to quickly change the basic style of your text. This is achieved in the following ways:
  • To make a piece of text bold enclose it in [b][/b], e.g.

    [b]Hello[/b]

    will become Hello
  • For underlining use [u][/u], for example:

    [u]Good Morning[/u]

    becomes Good Morning
  • To italicise text use [i][/i], e.g.

    This is [i]Great![/i]

    would give This is Great!
', + 'HELP_BBCODE_TEXT_BASIC_QUESTION' => 'How to create bold, italic and underlined text', + 'HELP_BBCODE_TEXT_COLOR_ANSWER' => 'To alter the colour or size of your text the following tags can be used. Keep in mind that how the output appears will depend on the viewers browser and system:
  • Changing the colour of text is achieved by wrapping it in [color=][/color]. You can specify either a recognised colour name (eg. red, blue, yellow, etc.) or the hexadecimal triplet alternative, e.g. #FFFFFF, #000000. For example, to create red text you could use:

    [color=red]Hello![/color]

    or

    [color=#FF0000]Hello![/color]

    Both will output Hello!
  • Changing the text size is achieved in a similar way using [size=][/size]. This tag is dependent on the template the user has selected but the recommended format is a numerical value representing the text size in percent, starting at 20 (very small) through to 200 (very large) by default. For example:

    [size=30]SMALL[/size]

    will generally be SMALL

    whereas:

    [size=200]HUGE![/size]

    will be HUGE!
', + 'HELP_BBCODE_TEXT_COLOR_QUESTION' => 'How to change the text colour or size', + 'HELP_BBCODE_TEXT_COMBINE_ANSWER' => 'Yes, of course you can, for example to get someones attention you may write:

[size=200][color=red][b]LOOK AT ME![/b][/color][/size]

this would output LOOK AT ME!

We don’t recommend you output lots of text that looks like this though! Remember it is up to you, the poster, to ensure tags are closed correctly. For example the following is incorrect:

[b][u]This is wrong[/b][/u]', + 'HELP_BBCODE_TEXT_COMBINE_QUESTION' => 'Can I combine formatting tags?', +); diff --git a/phpBB/language/en/help/faq.php b/phpBB/language/en/help/faq.php new file mode 100644 index 0000000000..fdb6f62aee --- /dev/null +++ b/phpBB/language/en/help/faq.php @@ -0,0 +1,186 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +/** + * DO NOT CHANGE + */ +if (!defined('IN_PHPBB')) +{ + exit; +} + +if (empty($lang) || !is_array($lang)) +{ + $lang = array(); +} + +$lang = array( + 'HELP_FAQ_ATTACHMENTS_ALLOWED_ANSWER' => 'Each board administrator can allow or disallow certain attachment types. If you are unsure what is allowed to be uploaded, contact the board administrator for assistance.', + 'HELP_FAQ_ATTACHMENTS_ALLOWED_QUESTION' => 'What attachments are allowed on this board?', + 'HELP_FAQ_ATTACHMENTS_OWN_ANSWER' => 'To find your list of attachments that you have uploaded, go to your User Control Panel and follow the links to the attachments section.', + 'HELP_FAQ_ATTACHMENTS_OWN_QUESTION' => 'How do I find all my attachments?', + + 'HELP_FAQ_BLOCK_ATTACHMENTS' => 'Attachments', + 'HELP_FAQ_BLOCK_BOOKMARKS' => 'Subscriptions and Bookmarks', + 'HELP_FAQ_BLOCK_FORMATTING' => 'Formatting and Topic Types', + 'HELP_FAQ_BLOCK_FRIENDS' => 'Friends and Foes', + 'HELP_FAQ_BLOCK_GROUPS' => 'User Levels and Groups', + 'HELP_FAQ_BLOCK_ISSUES' => 'phpBB Issues', + 'HELP_FAQ_BLOCK_LOGIN' => 'Login and Registration Issues', + 'HELP_FAQ_BLOCK_PMS' => 'Private Messaging', + 'HELP_FAQ_BLOCK_POSTING' => 'Posting Issues', + 'HELP_FAQ_BLOCK_SEARCH' => 'Searching the Forums', + 'HELP_FAQ_BLOCK_USERSETTINGS' => 'User Preferences and settings', + + 'HELP_FAQ_BOOKMARKS_DIFFERENCE_ANSWER' => 'In phpBB 3.0, bookmarking topics worked much like bookmarking in a web browser. You were not alerted when there was an update. As of phpBB 3.1, bookmarking is more like subscribing to a topic. You can be notified when a bookmarked topic is updated. Subscribing, however, will notify you when there is an update to a topic or forum on the board. Notification options for bookmarks and subscriptions can be configured in the User Control Panel, under “Board preferences”.', + 'HELP_FAQ_BOOKMARKS_DIFFERENCE_QUESTION' => 'What is the difference between bookmarking and subscribing?', + 'HELP_FAQ_BOOKMARKS_FORUM_ANSWER' => 'To subscribe to a specific forum, click the “Subscribe forum” link, at the bottom of page, upon entering the forum.', + 'HELP_FAQ_BOOKMARKS_FORUM_QUESTION' => 'How do I subscribe to specific forums?', + 'HELP_FAQ_BOOKMARKS_REMOVE_ANSWER' => 'To remove your subscriptions, go to your User Control Panel and follow the links to your subscriptions.', + 'HELP_FAQ_BOOKMARKS_REMOVE_QUESTION' => 'How do I remove my subscriptions?', + 'HELP_FAQ_BOOKMARKS_TOPIC_ANSWER' => 'You can bookmark or subscribe to a specific topic by clicking the appropriate link in the “Topic tools” menu, conveniently located near the top and bottom of a topic discussion.
Replying to a topic with the “Notify me when a reply is posted” option checked will also subscribe you to the topic.', + 'HELP_FAQ_BOOKMARKS_TOPIC_QUESTION' => 'How do I bookmark or subscribe to specific topics?', + + 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_ANSWER' => 'Announcements often contain important information for the forum you are currently reading and you should read them whenever possible. Announcements appear at the top of every page in the forum to which they are posted. As with global announcements, announcement permissions are granted by the board administrator.', + 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_QUESTION' => 'What are announcements?', + 'HELP_FAQ_FORMATTING_BBOCDE_ANSWER' => 'BBCode is a special implementation of HTML, offering great formatting control on particular objects in a post. The use of BBCode is granted by the administrator, but it can also be disabled on a per post basis from the posting form. BBCode itself is similar in style to HTML, but tags are enclosed in square brackets [ and ] rather than < and >. For more information on BBCode see the guide which can be accessed from the posting page.', + 'HELP_FAQ_FORMATTING_BBOCDE_QUESTION' => 'What is BBCode?', + 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_ANSWER' => 'Global announcements contain important information and you should read them whenever possible. They will appear at the top of every forum and within your User Control Panel. Global announcement permissions are granted by the board administrator.', + 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_QUESTION' => 'What are global announcements?', + 'HELP_FAQ_FORMATTING_HTML_ANSWER' => 'No. It is not possible to post HTML on this board and have it rendered as HTML. Most formatting which can be carried out using HTML can be applied using BBCode instead.', + 'HELP_FAQ_FORMATTING_HTML_QUESTION' => 'Can I use HTML?', + 'HELP_FAQ_FORMATTING_ICONS_ANSWER' => 'Topic icons are author chosen images associated with posts to indicate their content. The ability to use topic icons depends on the permissions set by the board administrator.', + 'HELP_FAQ_FORMATTING_ICONS_QUESTION' => 'What are topic icons?', + 'HELP_FAQ_FORMATTING_IMAGES_ANSWER' => 'Yes, images can be shown in your posts. If the administrator has allowed attachments, you may be able to upload the image to the board. Otherwise, you must link to an image stored on a publicly accessible web server, e.g. http://www.example.com/my-picture.gif. You cannot link to pictures stored on your own PC (unless it is a publicly accessible server) nor images stored behind authentication mechanisms, e.g. hotmail or yahoo mailboxes, password protected sites, etc. To display the image use the BBCode [img] tag.', + 'HELP_FAQ_FORMATTING_IMAGES_QUESTION' => 'Can I post images?', + 'HELP_FAQ_FORMATTING_LOCKED_ANSWER' => 'Locked topics are topics where users can no longer reply and any poll it contained was automatically ended. Topics may be locked for many reasons and were set this way by either the forum moderator or board administrator. You may also be able to lock your own topics depending on the permissions you are granted by the board administrator.', + 'HELP_FAQ_FORMATTING_LOCKED_QUESTION' => 'What are locked topics?', + 'HELP_FAQ_FORMATTING_SMILIES_ANSWER' => 'Smilies, or Emoticons, are small images which can be used to express a feeling using a short code, e.g. :) denotes happy, while :( denotes sad. The full list of emoticons can be seen in the posting form. Try not to overuse smilies, however, as they can quickly render a post unreadable and a moderator may edit them out or remove the post altogether. The board administrator may also have set a limit to the number of smilies you may use within a post.', + 'HELP_FAQ_FORMATTING_SMILIES_QUESTION' => 'What are Smilies?', + 'HELP_FAQ_FORMATTING_STICKIES_ANSWER' => 'Sticky topics within the forum appear below announcements and only on the first page. They are often quite important so you should read them whenever possible. As with announcements and global announcements, sticky topic permissions are granted by the board administrator.', + 'HELP_FAQ_FORMATTING_STICKIES_QUESTION' => 'What are sticky topics?', + + 'HELP_FAQ_FRIENDS_BASIC_ANSWER' => 'You can use these lists to organise other members of the board. Members added to your friends list will be listed within your User Control Panel for quick access to see their online status and to send them private messages. Subject to template support, posts from these users may also be highlighted. If you add a user to your foes list, any posts they make will be hidden by default.', + 'HELP_FAQ_FRIENDS_BASIC_QUESTION' => 'What are my Friends and Foes lists?', + 'HELP_FAQ_FRIENDS_MANAGE_ANSWER' => 'You can add users to your list in two ways. Within each user’s profile, there is a link to add them to either your Friend or Foe list. Alternatively, from your User Control Panel, you can directly add users by entering their member name. You may also remove users from your list using the same page.', + 'HELP_FAQ_FRIENDS_MANAGE_QUESTION' => 'How can I add / remove users to my Friends or Foes list?', + + 'HELP_FAQ_GROUPS_ADMINISTRATORS_ANSWER' => 'Administrators are members assigned with the highest level of control over the entire board. These members can control all facets of board operation, including setting permissions, banning users, creating usergroups or moderators, etc., dependent upon the board founder and what permissions he or she has given the other administrators. They may also have full moderator capabilities in all forums, depending on the settings put forth by the board founder.', + 'HELP_FAQ_GROUPS_ADMINISTRATORS_QUESTION' => 'What are Administrators?', + 'HELP_FAQ_GROUPS_COLORS_ANSWER' => 'It is possible for the board administrator to assign a colour to the members of a usergroup to make it easy to identify the members of this group.', + 'HELP_FAQ_GROUPS_COLORS_QUESTION' => 'Why do some usergroups appear in a different colour?', + 'HELP_FAQ_GROUPS_DEFAULT_ANSWER' => 'If you are a member of more than one usergroup, your default is used to determine which group colour and group rank should be shown for you by default. The board administrator may grant you permission to change your default usergroup via your User Control Panel.', + 'HELP_FAQ_GROUPS_DEFAULT_QUESTION' => 'What is a “Default usergroup”?', + 'HELP_FAQ_GROUPS_MODERATORS_ANSWER' => 'Moderators are individuals (or groups of individuals) who look after the forums from day to day. They have the authority to edit or delete posts and lock, unlock, move, delete and split topics in the forum they moderate. Generally, moderators are present to prevent users from going off-topic or posting abusive or offensive material.', + 'HELP_FAQ_GROUPS_MODERATORS_QUESTION' => 'What are Moderators?', + 'HELP_FAQ_GROUPS_TEAM_ANSWER' => 'This page provides you with a list of board staff, including board administrators and moderators and other details such as the forums they moderate.', + 'HELP_FAQ_GROUPS_TEAM_QUESTION' => 'What is “The team” link?', + 'HELP_FAQ_GROUPS_USERGROUPS_ANSWER' => 'Usergroups are groups of users that divide the community into manageable sections board administrators can work with. Each user can belong to several groups and each group can be assigned individual permissions. This provides an easy way for administrators to change permissions for many users at once, such as changing moderator permissions or granting users access to a private forum.', + 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_ANSWER' => 'You can view all usergroups via the “Usergroups” link within your User Control Panel. If you would like to join one, proceed by clicking the appropriate button. Not all groups have open access, however. Some may require approval to join, some may be closed and some may even have hidden memberships. If the group is open, you can join it by clicking the appropriate button. If a group requires approval to join you may request to join by clicking the appropriate button. The user group leader will need to approve your request and may ask why you want to join the group. Please do not harass a group leader if they reject your request; they will have their reasons.', + 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_QUESTION' => 'Where are the usergroups and how do I join one?', + 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_ANSWER' => 'A usergroup leader is usually assigned when usergroups are initially created by a board administrator. If you are interested in creating a usergroup, your first point of contact should be an administrator; try sending a private message.', + 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_QUESTION' => 'How do I become a usergroup leader?', + 'HELP_FAQ_GROUPS_USERGROUPS_QUESTION' => 'What are usergroups?', + + 'HELP_FAQ_ISSUES_ADMIN_ANSWER' => 'All users of the board can use the “Contact us” form, if the option was enabled by the board administrator.
Members of the board can also use the “The team” link.', + 'HELP_FAQ_ISSUES_ADMIN_QUESTION' => 'How do I contact a board administrator?', + 'HELP_FAQ_ISSUES_FEATURE_ANSWER' => 'This software was written by and licensed through phpBB Limited. If you believe a feature needs to be added please visit the phpBB Ideas Centre, where you can upvote existing ideas or suggest new features.', + 'HELP_FAQ_ISSUES_FEATURE_QUESTION' => 'Why isn’t X feature available?', + 'HELP_FAQ_ISSUES_LEGAL_ANSWER' => 'Any of the administrators listed on the “The team” page should be an appropriate point of contact for your complaints. If this still gets no response then you should contact the owner of the domain (do a whois lookup) or, if this is running on a free service (e.g. Yahoo!, free.fr, f2s.com, etc.), the management or abuse department of that service. Please note that the phpBB Limited has absolutely no jurisdiction and cannot in any way be held liable over how, where or by whom this board is used. Do not contact the phpBB Limited in relation to any legal (cease and desist, liable, defamatory comment, etc.) matter not directly related to the phpBB.com website or the discrete software of phpBB itself. If you do email phpBB Limited about any third party use of this software then you should expect a terse response or no response at all.', + 'HELP_FAQ_ISSUES_LEGAL_QUESTION' => 'Who do I contact about abusive and/or legal matters related to this board?', + 'HELP_FAQ_ISSUES_WHOIS_PHPBB_ANSWER' => 'This software (in its unmodified form) is produced, released and is copyright phpBB Limited. It is made available under the GNU General Public License, version 2 (GPL-2.0) and may be freely distributed. See About phpBB for more details.', + 'HELP_FAQ_ISSUES_WHOIS_PHPBB_QUESTION' => 'Who wrote this bulletin board?', + + 'HELP_FAQ_LOGIN_AUTO_LOGOUT_ANSWER' => 'If you do not check the Remember me box when you login, the board will only keep you logged in for a preset time. This prevents misuse of your account by anyone else. To stay logged in, check the Remember me box during login. This is not recommended if you access the board from a shared computer, e.g. library, internet cafe, university computer lab, etc. If you do not see this checkbox, it means a board administrator has disabled this feature.', + 'HELP_FAQ_LOGIN_AUTO_LOGOUT_QUESTION' => 'Why do I get logged off automatically?', + 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANSWER' => 'There are several reasons why this could occur. First, ensure your username and password are correct. If they are, contact a board administrator to make sure you haven’t been banned. It is also possible the website owner has a configuration error on their end, and they would need to fix it.', + 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_ANSWER' => 'It is possible an administrator has deactivated or deleted your account for some reason. Also, many boards periodically remove users who have not posted for a long time to reduce the size of the database. If this has happened, try registering again and being more involved in discussions.', + 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_QUESTION' => 'I registered in the past but cannot login any more?!', + 'HELP_FAQ_LOGIN_CANNOT_LOGIN_QUESTION' => 'Why can’t I login?', + 'HELP_FAQ_LOGIN_CANNOT_REGISTER_ANSWER' => 'It is possible a board administrator has disabled registration to prevent new visitors from signing up. A board administrator could have also banned your IP address or disallowed the username you are attempting to register. Contact a board administrator for assistance.', + 'HELP_FAQ_LOGIN_CANNOT_REGISTER_QUESTION' => 'Why can’t I register?', + 'HELP_FAQ_LOGIN_COPPA_ANSWER' => 'COPPA, or the Children’s Online Privacy Protection Act of 1998, is a law in the United States requiring websites which can potentially collect information from minors under the age of 13 to have written parental consent or some other method of legal guardian acknowledgment, allowing the collection of personally identifiable information from a minor under the age of 13. If you are unsure if this applies to you as someone trying to register or to the website you are trying to register on, contact legal counsel for assistance. Please note that phpBB Limited and the owners of this board cannot provide legal advice and is not a point of contact for legal concerns of any kind, except as outlined in question “Who do I contact about abusive and/or legal matters related to this board?”.', + 'HELP_FAQ_LOGIN_COPPA_QUESTION' => 'What is COPPA?', + 'HELP_FAQ_LOGIN_DELETE_COOKIES_ANSWER' => '“Delete all board cookies” deletes the cookies created by phpBB which keep you authenticated and logged into the board. Cookies also provide functions such as read tracking if they have been enabled by a board administrator. If you are having login or logout problems, deleting board cookies may help.', + 'HELP_FAQ_LOGIN_DELETE_COOKIES_QUESTION' => 'What does the “Delete all board cookies” do?', + 'HELP_FAQ_LOGIN_LOST_PASSWORD_ANSWER' => 'Don’t panic! While your password cannot be retrieved, it can easily be reset. Visit the login page and click I forgot my password. Follow the instructions and you should be able to log in again shortly.
However, if you are not able to reset your password, contact a board administrator.', + 'HELP_FAQ_LOGIN_LOST_PASSWORD_QUESTION' => 'I’ve lost my password!', + 'HELP_FAQ_LOGIN_REGISTER_ANSWER' => 'You may not have to, it is up to the administrator of the board as to whether you need to register in order to post messages. However; registration will give you access to additional features not available to guest users such as definable avatar images, private messaging, emailing of fellow users, usergroup subscription, etc. It only takes a few moments to register so it is recommended you do so.', + 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_ANSWER' => 'First, check your username and password. If they are correct, then one of two things may have happened. If COPPA support is enabled and you specified being under 13 years old during registration, you will have to follow the instructions you received. Some boards will also require new registrations to be activated, either by yourself or by an administrator before you can logon; this information was present during registration. If you were sent an email, follow the instructions. If you did not receive an email, you may have provided an incorrect email address or the email may have been picked up by a spam filer. If you are sure the email address you provided is correct, try contacting an administrator.', + 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_QUESTION' => 'I registered but cannot login!', + 'HELP_FAQ_LOGIN_REGISTER_QUESTION' => 'Why do I need to register?', + + 'HELP_FAQ_PMS_CANNOT_SEND_ANSWER' => 'There are three reasons for this; you are not registered and/or not logged on, the board administrator has disabled private messaging for the entire board, or the board administrator has prevented you from sending messages. Contact a board administrator for more information.', + 'HELP_FAQ_PMS_CANNOT_SEND_QUESTION' => 'I cannot send private messages!', + 'HELP_FAQ_PMS_SPAM_ANSWER' => 'We are sorry to hear that. The email form feature of this board includes safeguards to try and track users who send such posts, so email the board administrator with a full copy of the email you received. It is very important that this includes the headers that contain the details of the user that sent the email. The board administrator can then take action.', + 'HELP_FAQ_PMS_SPAM_QUESTION' => 'I have received a spamming or abusive email from someone on this board!', + 'HELP_FAQ_PMS_UNWANTED_ANSWER' => 'You can automatically delete private messages from a user by using message rules within your User Control Panel. If you are receiving abusive private messages from a particular user, report the messages to the moderators; they have the power to prevent a user from sending private messages.', + 'HELP_FAQ_PMS_UNWANTED_QUESTION' => 'I keep getting unwanted private messages!', + + 'HELP_FAQ_POSTING_BUMP_ANSWER' => 'By clicking the “Bump topic” link when you are viewing it, you can “bump” the topic to the top of the forum on the first page. However, if you do not see this, then topic bumping may be disabled or the time allowance between bumps has not yet been reached. It is also possible to bump the topic simply by replying to it, however, be sure to follow the board rules when doing so.', + 'HELP_FAQ_POSTING_BUMP_QUESTION' => 'How do I bump my topic?', + 'HELP_FAQ_POSTING_CREATE_ANSWER' => 'To post a new topic in a forum, click "New Topic". To post a reply to a topic, click "Post Reply". You may need to register before you can post a message. A list of your permissions in each forum is available at the bottom of the forum and topic screens. Example: You can post new topics, You can post attachments, etc.', + 'HELP_FAQ_POSTING_CREATE_QUESTION' => 'How do I create a new topic or post a reply?', + 'HELP_FAQ_POSTING_DRAFT_ANSWER' => 'This allows you to save drafts to be completed and submitted at a later date. To reload a saved draft, visit the User Control Panel.', + 'HELP_FAQ_POSTING_DRAFT_QUESTION' => 'What is the “Save” button for in topic posting?', + 'HELP_FAQ_POSTING_EDIT_DELETE_ANSWER' => 'Unless you are a board administrator or moderator, you can only edit or delete your own posts. You can edit a post by clicking the edit button for the relevant post, sometimes for only a limited time after the post was made. If someone has already replied to the post, you will find a small piece of text output below the post when you return to the topic which lists the number of times you edited it along with the date and time. This will only appear if someone has made a reply; it will not appear if a moderator or administrator edited the post, though they may leave a note as to why they’ve edited the post at their own discretion. Please note that normal users cannot delete a post once someone has replied.', + 'HELP_FAQ_POSTING_EDIT_DELETE_QUESTION' => 'How do I edit or delete a post?', + 'HELP_FAQ_POSTING_FORUM_RESTRICTED_ANSWER' => 'Some forums may be limited to certain users or groups. To view, read, post or perform another action you may need special permissions. Contact a moderator or board administrator to grant you access.', + 'HELP_FAQ_POSTING_FORUM_RESTRICTED_QUESTION' => 'Why can’t I access a forum?', + 'HELP_FAQ_POSTING_NO_ATTACHMENTS_ANSWER' => 'Attachment permissions are granted on a per forum, per group, or per user basis. The board administrator may not have allowed attachments to be added for the specific forum you are posting in, or perhaps only certain groups can post attachments. Contact the board administrator if you are unsure about why you are unable to add attachments.', + 'HELP_FAQ_POSTING_NO_ATTACHMENTS_QUESTION' => 'Why can’t I add attachments?', + 'HELP_FAQ_POSTING_POLL_ADD_ANSWER' => 'The limit for poll options is set by the board administrator. If you feel you need to add more options to your poll than the allowed amount, contact the board administrator.', + 'HELP_FAQ_POSTING_POLL_ADD_QUESTION' => 'Why can’t I add more poll options?', + 'HELP_FAQ_POSTING_POLL_CREATE_ANSWER' => 'When posting a new topic or editing the first post of a topic, click the “Poll creation” tab below the main posting form; if you cannot see this, you do not have appropriate permissions to create polls. Enter a title and at least two options in the appropriate fields, making sure each option is on a separate line in the textarea. You can also set the number of options users may select during voting under “Options per user”, a time limit in days for the poll (0 for infinite duration) and lastly the option to allow users to amend their votes.', + 'HELP_FAQ_POSTING_POLL_CREATE_QUESTION' => 'How do I create a poll?', + 'HELP_FAQ_POSTING_POLL_EDIT_ANSWER' => 'As with posts, polls can only be edited by the original poster, a moderator or an administrator. To edit a poll, click to edit the first post in the topic; this always has the poll associated with it. If no one has cast a vote, users can delete the poll or edit any poll option. However, if members have already placed votes, only moderators or administrators can edit or delete it. This prevents the poll’s options from being changed mid-way through a poll.', + 'HELP_FAQ_POSTING_POLL_EDIT_QUESTION' => 'How do I edit or delete a poll?', + 'HELP_FAQ_POSTING_QUEUE_ANSWER' => 'The board administrator may have decided that posts in the forum you are posting to require review before submission. It is also possible that the administrator has placed you in a group of users whose posts require review before submission. Please contact the board administrator for further details.', + 'HELP_FAQ_POSTING_QUEUE_QUESTION' => 'Why does my post need to be approved?', + 'HELP_FAQ_POSTING_REPORT_ANSWER' => 'If the board administrator has allowed it, you should see a button for reporting posts next to the post you wish to report. Clicking this will walk you through the steps necessary to report the post.', + 'HELP_FAQ_POSTING_REPORT_QUESTION' => 'How can I report posts to a moderator?', + 'HELP_FAQ_POSTING_SIGNATURE_ANSWER' => 'To add a signature to a post you must first create one via your User Control Panel. Once created, you can check the Attach a signature box on the posting form to add your signature. You can also add a signature by default to all your posts by checking the appropriate radio button in the User Control Panel. If you do so, you can still prevent a signature being added to individual posts by un-checking the add signature box within the posting form.', + 'HELP_FAQ_POSTING_SIGNATURE_QUESTION' => 'How do I add a signature to my post?', + 'HELP_FAQ_POSTING_WARNING_ANSWER' => 'Each board administrator has their own set of rules for their site. If you have broken a rule, you may be issued a warning. Please note that this is the board administrator’s decision, and the phpBB Limited has nothing to do with the warnings on the given site. Contact the board administrator if you are unsure about why you were issued a warning.', + 'HELP_FAQ_POSTING_WARNING_QUESTION' => 'Why did I receive a warning?', + + 'HELP_FAQ_SEARCH_BLANK_ANSWER' => 'Your search returned too many results for the webserver to handle. Use “Advanced search” and be more specific in the terms used and forums that are to be searched.', + 'HELP_FAQ_SEARCH_BLANK_QUESTION' => 'Why does my search return a blank page!?', + 'HELP_FAQ_SEARCH_FORUM_ANSWER' => 'Enter a search term in the search box located on the index, forum or topic pages. Advanced search can be accessed by clicking the “Advance Search” link which is available on all pages on the forum. How to access the search may depend on the style used.', + 'HELP_FAQ_SEARCH_FORUM_QUESTION' => 'How can I search a forum or forums?', + 'HELP_FAQ_SEARCH_MEMBERS_ANSWER' => 'Visit to the “Members” page and click the “Find a member” link.', + 'HELP_FAQ_SEARCH_MEMBERS_QUESTION' => 'How do I search for members?', + 'HELP_FAQ_SEARCH_NO_RESULT_ANSWER' => 'Your search was probably too vague and included many common terms which are not indexed by phpBB. Be more specific and use the options available within Advanced search.', + 'HELP_FAQ_SEARCH_NO_RESULT_QUESTION' => 'Why does my search return no results?', + 'HELP_FAQ_SEARCH_OWN_ANSWER' => 'Your own posts can be retrieved either by clicking the “Show your posts” link within the User Control Panel or by clicking the “Search user’s posts” link via your own profile page or by clicking the “Quick links” menu at the top of the board. To search for your topics, use the Advanced search page and fill in the various options appropriately.', + 'HELP_FAQ_SEARCH_OWN_QUESTION' => 'How can I find my own posts and topics?', + + 'HELP_FAQ_USERSETTINGS_AVATAR_ANSWER' => 'There are two images which may appear along with a username when viewing posts. One of them may be an image associated with your rank, generally in the form of stars, blocks or dots, indicating how many posts you have made or your status on the board. Another, usually larger, image is known as an avatar and is generally unique or personal to each user.', + 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_ANSWER' => 'Within your User Control Panel, under “Profile” you can add an avatar by using one of the four following methods: Gravatar, Gallery, Remote or Upload. It is up to the board administrator to enable avatars and to choose the way in which avatars can be made available. If you are unable to use avatars, contact a board administrator.', + 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_QUESTION' => 'How do I display an avatar?', + 'HELP_FAQ_USERSETTINGS_AVATAR_QUESTION' => 'What are the images next to my username?', + 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_ANSWER' => 'If you are a registered user, all your settings are stored in the board database. To alter them, visit your User Control Panel; a link can usually be found by clicking on your username at the top of board pages. This system will allow you to change all your settings and preferences.', + 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_QUESTION' => 'How do I change my settings?', + 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_ANSWER' => 'Only registered users can send email to other users via the built-in email form, and only if the administrator has enabled this feature. This is to prevent malicious use of the email system by anonymous users.', + 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_QUESTION' => 'When I click the email link for a user it asks me to login?', + 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_ANSWER' => 'Within your User Control Panel, under “Board preferences”, you will find the option Hide your online status. Enable this option and you will only appear to the administrators, moderators and yourself. You will be counted as a hidden user.', + 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_QUESTION' => 'How do I prevent my username appearing in the online user listings?', + 'HELP_FAQ_USERSETTINGS_LANGUAGE_ANSWER' => 'Either the administrator has not installed your language or nobody has translated this board into your language. Try asking a board administrator if they can install the language pack you need. If the language pack does not exist, feel free to create a new translation. More information can be found at the phpBB® website.', + 'HELP_FAQ_USERSETTINGS_LANGUAGE_QUESTION' => 'My language is not in the list!', + 'HELP_FAQ_USERSETTINGS_RANK_ANSWER' => 'Ranks, which appear below your username, indicate the number of posts you have made or identify certain users, e.g. moderators and administrators. In general, you cannot directly change the wording of any board ranks as they are set by the board administrator. Please do not abuse the board by posting unnecessarily just to increase your rank. Most boards will not tolerate this and the moderator or administrator will simply lower your post count.', + 'HELP_FAQ_USERSETTINGS_RANK_QUESTION' => 'What is my rank and how do I change it?', + 'HELP_FAQ_USERSETTINGS_SERVERTIME_ANSWER' => 'If you are sure you have set the timezone correctly and the time is still incorrect, then the time stored on the server clock is incorrect. Please notify an administrator to correct the problem.', + 'HELP_FAQ_USERSETTINGS_SERVERTIME_QUESTION' => 'I changed the timezone and the time is still wrong!', + 'HELP_FAQ_USERSETTINGS_TIMEZONE_ANSWER' => 'It is possible the time displayed is from a timezone different from the one you are in. If this is the case, visit your User Control Panel and change your timezone to match your particular area, e.g. London, Paris, New York, Sydney, etc. Please note that changing the timezone, like most settings, can only be done by registered users. If you are not registered, this is a good time to do so.', + 'HELP_FAQ_USERSETTINGS_TIMEZONE_QUESTION' => 'The times are not correct!', +); From ff7e9dc91262aa43c6153831a33fda13d5324325 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 16 May 2015 18:49:32 +0200 Subject: [PATCH 3/9] [ticket/13844] Refactor bbcode help to the new system PHPBB3-13844 --- .../default/container/services_help.yml | 17 ++++ phpBB/config/default/routing/help.yml | 3 + phpBB/phpbb/help/controller/bbcode.php | 85 +++++++++++++++++++ phpBB/phpbb/help/controller/controller.php | 81 ++++++++++++++++++ phpBB/phpbb/help/manager.php | 85 +++++++++++++++++++ 5 files changed, 271 insertions(+) create mode 100644 phpBB/phpbb/help/controller/bbcode.php create mode 100644 phpBB/phpbb/help/controller/controller.php create mode 100644 phpBB/phpbb/help/manager.php diff --git a/phpBB/config/default/container/services_help.yml b/phpBB/config/default/container/services_help.yml index ae3eafe7b0..c37d24b412 100644 --- a/phpBB/config/default/container/services_help.yml +++ b/phpBB/config/default/container/services_help.yml @@ -1,4 +1,10 @@ services: + phpbb.help.manager: + class: phpbb\help\manager + arguments: + - @template + - @language + phpbb.help.controller: class: phpbb\help\controller\help arguments: @@ -8,3 +14,14 @@ services: - @user - %core.root_path% - %core.php_ext% + + phpbb.help.controller.bbcode: + class: phpbb\help\controller\bbcode + arguments: + - @controller.helper + - @dispatcher + - @phpbb.help.manager + - @template + - @language + - %core.root_path% + - %core.php_ext% diff --git a/phpBB/config/default/routing/help.yml b/phpBB/config/default/routing/help.yml index 957d6dab55..9b15040875 100644 --- a/phpBB/config/default/routing/help.yml +++ b/phpBB/config/default/routing/help.yml @@ -1,3 +1,6 @@ phpbb_help_controller: + path: /bbcode + defaults: { _controller: phpbb.help.controller.bbcode:handle } + path: /{mode} defaults: { _controller: phpbb.help.controller:handle } diff --git a/phpBB/phpbb/help/controller/bbcode.php b/phpBB/phpbb/help/controller/bbcode.php new file mode 100644 index 0000000000..e16f99023d --- /dev/null +++ b/phpBB/phpbb/help/controller/bbcode.php @@ -0,0 +1,85 @@ + + * @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\help\controller; + +/** + * BBCode help page + */ +class bbcode extends controller +{ + /** + * @return string The title of the page + */ + public function display() + { + $this->language->add_lang('help/bbcode'); + + $this->manager->add_block( + 'HELP_BBCODE_BLOCK_INTRO', + false, + array( + 'HELP_BBCODE_INTRO_BBCODE_QUESTION' => 'HELP_BBCODE_INTRO_BBCODE_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_BBCODE_BLOCK_TEXT', + false, + array( + 'HELP_BBCODE_TEXT_BASIC_QUESTION' => 'HELP_BBCODE_TEXT_BASIC_ANSWER', + 'HELP_BBCODE_TEXT_COLOR_QUESTION' => 'HELP_BBCODE_TEXT_COLOR_ANSWER', + 'HELP_BBCODE_TEXT_COMBINE_QUESTION' => 'HELP_BBCODE_TEXT_COMBINE_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_BBCODE_BLOCK_QUOTES', + false, + array( + 'HELP_BBCODE_QUOTES_TEXT_QUESTION' => 'HELP_BBCODE_QUOTES_TEXT_ANSWER', + 'HELP_BBCODE_QUOTES_CODE_QUESTION' => 'HELP_BBCODE_QUOTES_CODE_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_BBCODE_BLOCK_LISTS', + false, + array( + 'HELP_BBCODE_LISTS_UNORDERER_QUESTION' => 'HELP_BBCODE_LISTS_UNORDERER_ANSWER', + 'HELP_BBCODE_LISTS_ORDERER_QUESTION' => 'HELP_BBCODE_LISTS_ORDERER_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_BBCODE_BLOCK_LINKS', + true, + array( + 'HELP_BBCODE_LINKS_BASIC_QUESTION' => 'HELP_BBCODE_LINKS_BASIC_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_BBCODE_BLOCK_IMAGES', + false, + array( + 'HELP_BBCODE_IMAGES_BASIC_QUESTION' => 'HELP_BBCODE_IMAGES_BASIC_ANSWER', + 'HELP_BBCODE_IMAGES_ATTACHMENT_QUESTION' => 'HELP_BBCODE_IMAGES_ATTACHMENT_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_BBCODE_BLOCK_OTHERS', + false, + array( + 'HELP_BBCODE_OTHERS_CUSTOM_QUESTION' => 'HELP_BBCODE_OTHERS_CUSTOM_ANSWER', + ) + ); + + return $this->language->lang('BBCODE_GUIDE'); + } +} diff --git a/phpBB/phpbb/help/controller/controller.php b/phpBB/phpbb/help/controller/controller.php new file mode 100644 index 0000000000..743a9c7fde --- /dev/null +++ b/phpBB/phpbb/help/controller/controller.php @@ -0,0 +1,81 @@ + + * @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\help\controller; + +/** + * BBCode help page + */ +abstract class controller +{ + /** @var \phpbb\controller\helper */ + protected $helper; + + /** @var \phpbb\event\dispatcher_interface */ + protected $dispatcher; + + /** @var \phpbb\help\manager */ + protected $manager; + + /** @var \phpbb\template\template */ + protected $template; + + /** @var \phpbb\language\language */ + protected $language; + + /** @var string */ + protected $root_path; + + /** @var string */ + protected $php_ext; + + /** + * Constructor + * + * @param \phpbb\controller\helper $helper + * @param \phpbb\event\dispatcher_interface $dispatcher + * @param \phpbb\help\manager $manager + * @param \phpbb\template\template $template + * @param \phpbb\language\language $language + * @param string $root_path + * @param string $php_ext + */ + public function __construct(\phpbb\controller\helper $helper, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\help\manager $manager, \phpbb\template\template $template, \phpbb\language\language $language, $root_path, $php_ext) + { + $this->helper = $helper; + $this->dispatcher = $dispatcher; + $this->manager = $manager; + $this->template = $template; + $this->language = $language; + $this->root_path = $root_path; + $this->php_ext = $php_ext; + } + + /** + * @return string + */ + abstract protected function display(); + + public function handle() + { + $title = $this->display(); + + $this->template->assign_vars(array( + 'L_FAQ_TITLE' => $title, + 'S_IN_FAQ' => true, + )); + + make_jumpbox(append_sid("{$this->root_path}viewforum.{$this->php_ext}")); + return $this->helper->render('faq_body.html', $title); + } +} diff --git a/phpBB/phpbb/help/manager.php b/phpBB/phpbb/help/manager.php new file mode 100644 index 0000000000..a7320563a8 --- /dev/null +++ b/phpBB/phpbb/help/manager.php @@ -0,0 +1,85 @@ + + * @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\help; + +/** + * Class help page manager + */ +class manager +{ + /** @var \phpbb\template\template */ + protected $template; + + /** @var \phpbb\language\language */ + protected $language; + + /** @var bool */ + protected $switched_column; + + /** + * Constructor + * + * @param \phpbb\template\template $template + * @param \phpbb\language\language $language + */ + public function __construct(\phpbb\template\template $template, \phpbb\language\language $language) + { + $this->template = $template; + $this->language = $language; + } + + /** + * Add a new faq block + * + * @param string $block_name Name or language key with the name of the block + * @param bool $switch_column Switch the column of the menu + */ + public function add_block($block_name, $switch_column = false, $questions = array()) + { + $this->template->assign_block_vars('faq_block', array( + 'BLOCK_TITLE' => $this->language->lang($block_name), + 'SWITCH_COLUMN' => !$this->switched_column && $switch_column, + )); + + foreach ($questions as $question => $answer) + { + $this->add_question($question, $answer); + } + + $this->switched_column = $this->switched_column || $switch_column; + } + + /** + * Add a new faq question + * + * @param string $question Question or language key with the question of the block + * @param string $answer Answer or language key with the answer of the block + */ + public function add_question($question, $answer) + { + $this->template->assign_block_vars('faq_block.faq_row', array( + 'FAQ_QUESTION' => $this->language->lang($question), + 'FAQ_ANSWER' => $this->language->lang($answer), + )); + } + + /** + * Returns whether the block titles switched side + * @return bool + */ + public function switched_column() + { + return $this->switched_column; + } +} From 07231e7943e9ffdba08393be56510e682ab7a7e5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 16 May 2015 22:06:37 +0200 Subject: [PATCH 4/9] [ticket/13844] FAQ in new controller format PHPBB3-13844 --- .../default/container/services_help.yml | 21 +-- phpBB/config/default/routing/help.yml | 7 +- phpBB/develop/lang_migrate_help_lang.php | 2 +- phpBB/faq.php | 7 +- phpBB/includes/acp/acp_contact.php | 2 +- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/functions.php | 2 +- phpBB/includes/ucp/ucp_pm_compose.php | 2 +- phpBB/includes/ucp/ucp_profile.php | 2 +- phpBB/phpbb/help/controller/faq.php | 165 ++++++++++++++++++ phpBB/posting.php | 2 +- phpBB/viewonline.php | 2 +- 12 files changed, 192 insertions(+), 24 deletions(-) create mode 100644 phpBB/phpbb/help/controller/faq.php diff --git a/phpBB/config/default/container/services_help.yml b/phpBB/config/default/container/services_help.yml index c37d24b412..29523ffb27 100644 --- a/phpBB/config/default/container/services_help.yml +++ b/phpBB/config/default/container/services_help.yml @@ -5,16 +5,6 @@ services: - @template - @language - phpbb.help.controller: - class: phpbb\help\controller\help - arguments: - - @controller.helper - - @dispatcher - - @template - - @user - - %core.root_path% - - %core.php_ext% - phpbb.help.controller.bbcode: class: phpbb\help\controller\bbcode arguments: @@ -25,3 +15,14 @@ services: - @language - %core.root_path% - %core.php_ext% + + phpbb.help.controller.faq: + class: phpbb\help\controller\faq + arguments: + - @controller.helper + - @dispatcher + - @phpbb.help.manager + - @template + - @language + - %core.root_path% + - %core.php_ext% diff --git a/phpBB/config/default/routing/help.yml b/phpBB/config/default/routing/help.yml index 9b15040875..8d43839d1e 100644 --- a/phpBB/config/default/routing/help.yml +++ b/phpBB/config/default/routing/help.yml @@ -1,6 +1,7 @@ -phpbb_help_controller: +phpbb_help_bbcode_controller: path: /bbcode defaults: { _controller: phpbb.help.controller.bbcode:handle } - path: /{mode} - defaults: { _controller: phpbb.help.controller:handle } +phpbb_help_faq_controller: + path: /faq + defaults: { _controller: phpbb.help.controller.faq:handle } diff --git a/phpBB/develop/lang_migrate_help_lang.php b/phpBB/develop/lang_migrate_help_lang.php index 28a8ee058b..d523493c83 100644 --- a/phpBB/develop/lang_migrate_help_lang.php +++ b/phpBB/develop/lang_migrate_help_lang.php @@ -228,7 +228,7 @@ $lang_phpbb = array( 'HELP_FAQ_ISSUES_ADMIN_ANSWER' => $help_phpbb[79][1], ); -write_help('phpbb', $lang_phpbb); +write_help('faq', $lang_phpbb); trigger_error('Successfully migrated help_bbcode and help_faq to help/bbcode and help/phpbb'); diff --git a/phpBB/faq.php b/phpBB/faq.php index 7420bc5a95..36a33c97a8 100644 --- a/phpBB/faq.php +++ b/phpBB/faq.php @@ -28,8 +28,9 @@ $user->setup(); $controller_helper = $phpbb_container->get('controller.helper'); $response = new \Symfony\Component\HttpFoundation\RedirectResponse( - $controller_helper->route('phpbb_help_controller', array( - 'mode' => $request->variable('mode', 'faq'), - ), 301) + $controller_helper->route( + $request->variable('mode', 'faq') === 'bbcode' ? 'phpbb_help_bbcode_controller' : 'phpbb_help_faq_controller' + ), + 301 ); $response->send(); diff --git a/phpBB/includes/acp/acp_contact.php b/phpBB/includes/acp/acp_contact.php index 945add66a4..1a4d5b95a3 100644 --- a/phpBB/includes/acp/acp_contact.php +++ b/phpBB/includes/acp/acp_contact.php @@ -119,7 +119,7 @@ class acp_contact 'S_SMILIES_DISABLE_CHECKED' => !$contact_admin_edit['allow_smilies'], 'S_MAGIC_URL_DISABLE_CHECKED' => !$contact_admin_edit['allow_urls'], - 'BBCODE_STATUS' => $user->lang('BBCODE_IS_ON', '', ''), + 'BBCODE_STATUS' => $user->lang('BBCODE_IS_ON', '', ''), 'SMILIES_STATUS' => $user->lang['SMILIES_ARE_ON'], 'IMG_STATUS' => $user->lang['IMAGES_ARE_ON'], 'FLASH_STATUS' => $user->lang['FLASH_IS_ON'], diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index fec32146c1..0ec17ccf0c 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2045,7 +2045,7 @@ class acp_users 'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '', 'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' checked="checked"' : '', - 'BBCODE_STATUS' => $user->lang(($config['allow_sig_bbcode'] ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '', ''), + 'BBCODE_STATUS' => $user->lang(($config['allow_sig_bbcode'] ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '', ''), 'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 2ed0eff81c..b844d8a378 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4309,7 +4309,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id = 'U_PROFILE' => append_sid("{$phpbb_root_path}ucp.$phpEx"), 'U_USER_PROFILE' => get_username_string('profile', $user->data['user_id'], $user->data['username'], $user->data['user_colour']), 'U_MODCP' => append_sid("{$phpbb_root_path}mcp.$phpEx", false, true, $user->session_id), - 'U_FAQ' => $controller_helper->route('phpbb_help_controller', array('mode' => 'faq')), + 'U_FAQ' => $controller_helper->route('phpbb_help_faq_controller'), 'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=egosearch'), 'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts'), 'U_SEARCH_UNANSWERED' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered'), diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 59952182df..4982b6ad6a 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -1157,7 +1157,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) 'SUBJECT' => (isset($message_subject)) ? $message_subject : '', 'MESSAGE' => $message_text, - 'BBCODE_STATUS' => $user->lang(($bbcode_status ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '', ''), + 'BBCODE_STATUS' => $user->lang(($bbcode_status ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '', ''), 'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], 'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 66eae22a1b..2f4d650ed0 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -572,7 +572,7 @@ class ucp_profile 'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '', 'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' checked="checked"' : '', - 'BBCODE_STATUS' => $user->lang(($config['allow_sig_bbcode'] ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '', ''), + 'BBCODE_STATUS' => $user->lang(($config['allow_sig_bbcode'] ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '', ''), 'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], diff --git a/phpBB/phpbb/help/controller/faq.php b/phpBB/phpbb/help/controller/faq.php new file mode 100644 index 0000000000..5e45cfe667 --- /dev/null +++ b/phpBB/phpbb/help/controller/faq.php @@ -0,0 +1,165 @@ + + * @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\help\controller; + +/** + * FAQ help page + */ +class faq extends controller +{ + /** + * @return string The title of the page + */ + public function display() + { + $this->language->add_lang('help/faq'); + + $this->manager->add_block( + 'HELP_FAQ_BLOCK_LOGIN', + false, + array( + 'HELP_FAQ_LOGIN_REGISTER_QUESTION' => 'HELP_FAQ_LOGIN_REGISTER_ANSWER', + 'HELP_FAQ_LOGIN_COPPA_QUESTION' => 'HELP_FAQ_LOGIN_COPPA_ANSWER', + 'HELP_FAQ_LOGIN_CANNOT_REGISTER_QUESTION' => 'HELP_FAQ_LOGIN_CANNOT_REGISTER_ANSWER', + 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_QUESTION' => 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_ANSWER', + 'HELP_FAQ_LOGIN_CANNOT_LOGIN_QUESTION' => 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANSWER', + 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_QUESTION' => 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_ANSWER', + 'HELP_FAQ_LOGIN_LOST_PASSWORD_QUESTION' => 'HELP_FAQ_LOGIN_LOST_PASSWORD_ANSWER', + 'HELP_FAQ_LOGIN_AUTO_LOGOUT_QUESTION' => 'HELP_FAQ_LOGIN_AUTO_LOGOUT_ANSWER', + 'HELP_FAQ_LOGIN_DELETE_COOKIES_QUESTION' => 'HELP_FAQ_LOGIN_DELETE_COOKIES_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_FAQ_BLOCK_USERSETTINGS', + false, + array( + 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_QUESTION' => 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_ANSWER', + 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_QUESTION' => 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_ANSWER', + 'HELP_FAQ_USERSETTINGS_TIMEZONE_QUESTION' => 'HELP_FAQ_USERSETTINGS_TIMEZONE_ANSWER', + 'HELP_FAQ_USERSETTINGS_SERVERTIME_QUESTION' => 'HELP_FAQ_USERSETTINGS_SERVERTIME_ANSWER', + 'HELP_FAQ_USERSETTINGS_LANGUAGE_QUESTION' => 'HELP_FAQ_USERSETTINGS_LANGUAGE_ANSWER', + 'HELP_FAQ_USERSETTINGS_AVATAR_QUESTION' => 'HELP_FAQ_USERSETTINGS_AVATAR_ANSWER', + 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_QUESTION' => 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_ANSWER', + 'HELP_FAQ_USERSETTINGS_RANK_QUESTION' => 'HELP_FAQ_USERSETTINGS_RANK_ANSWER', + 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_QUESTION' => 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_FAQ_BLOCK_POSTING', + false, + array( + 'HELP_FAQ_POSTING_CREATE_QUESTION' => 'HELP_FAQ_POSTING_CREATE_ANSWER', + 'HELP_FAQ_POSTING_EDIT_DELETE_QUESTION' => 'HELP_FAQ_POSTING_EDIT_DELETE_ANSWER', + 'HELP_FAQ_POSTING_SIGNATURE_QUESTION' => 'HELP_FAQ_POSTING_SIGNATURE_ANSWER', + 'HELP_FAQ_POSTING_POLL_CREATE_QUESTION' => 'HELP_FAQ_POSTING_POLL_CREATE_ANSWER', + 'HELP_FAQ_POSTING_POLL_ADD_QUESTION' => 'HELP_FAQ_POSTING_POLL_ADD_ANSWER', + 'HELP_FAQ_POSTING_POLL_EDIT_QUESTION' => 'HELP_FAQ_POSTING_POLL_EDIT_ANSWER', + 'HELP_FAQ_POSTING_FORUM_RESTRICTED_QUESTION' => 'HELP_FAQ_POSTING_FORUM_RESTRICTED_ANSWER', + 'HELP_FAQ_POSTING_NO_ATTACHMENTS_QUESTION' => 'HELP_FAQ_POSTING_NO_ATTACHMENTS_ANSWER', + 'HELP_FAQ_POSTING_WARNING_QUESTION' => 'HELP_FAQ_POSTING_WARNING_ANSWER', + 'HELP_FAQ_POSTING_REPORT_QUESTION' => 'HELP_FAQ_POSTING_REPORT_ANSWER', + 'HELP_FAQ_POSTING_DRAFT_QUESTION' => 'HELP_FAQ_POSTING_DRAFT_ANSWER', + 'HELP_FAQ_POSTING_QUEUE_QUESTION' => 'HELP_FAQ_POSTING_QUEUE_ANSWER', + 'HELP_FAQ_POSTING_BUMP_QUESTION' => 'HELP_FAQ_POSTING_BUMP_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_FAQ_BLOCK_FORMATTING', + false, + array( + 'HELP_FAQ_FORMATTING_BBOCDE_QUESTION' => 'HELP_FAQ_FORMATTING_BBOCDE_ANSWER', + 'HELP_FAQ_FORMATTING_HTML_QUESTION' => 'HELP_FAQ_FORMATTING_HTML_ANSWER', + 'HELP_FAQ_FORMATTING_SMILIES_QUESTION' => 'HELP_FAQ_FORMATTING_SMILIES_ANSWER', + 'HELP_FAQ_FORMATTING_IMAGES_QUESTION' => 'HELP_FAQ_FORMATTING_IMAGES_ANSWER', + 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_QUESTION' => 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_ANSWER', + 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_QUESTION' => 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_ANSWER', + 'HELP_FAQ_FORMATTING_STICKIES_QUESTION' => 'HELP_FAQ_FORMATTING_STICKIES_ANSWER', + 'HELP_FAQ_FORMATTING_LOCKED_QUESTION' => 'HELP_FAQ_FORMATTING_LOCKED_ANSWER', + 'HELP_FAQ_FORMATTING_ICONS_QUESTION' => 'HELP_FAQ_FORMATTING_ICONS_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_FAQ_BLOCK_GROUPS', + true, + array( + 'HELP_FAQ_GROUPS_ADMINISTRATORS_QUESTION' => 'HELP_FAQ_GROUPS_ADMINISTRATORS_ANSWER', + 'HELP_FAQ_GROUPS_MODERATORS_QUESTION' => 'HELP_FAQ_GROUPS_MODERATORS_ANSWER', + 'HELP_FAQ_GROUPS_USERGROUPS_QUESTION' => 'HELP_FAQ_GROUPS_USERGROUPS_ANSWER', + 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_QUESTION' => 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_ANSWER', + 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_QUESTION' => 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_ANSWER', + 'HELP_FAQ_GROUPS_COLORS_QUESTION' => 'HELP_FAQ_GROUPS_COLORS_ANSWER', + 'HELP_FAQ_GROUPS_DEFAULT_QUESTION' => 'HELP_FAQ_GROUPS_DEFAULT_ANSWER', + 'HELP_FAQ_GROUPS_TEAM_QUESTION' => 'HELP_FAQ_GROUPS_TEAM_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_FAQ_BLOCK_PMS', + false, + array( + 'HELP_FAQ_PMS_CANNOT_SEND_QUESTION' => 'HELP_FAQ_PMS_CANNOT_SEND_ANSWER', + 'HELP_FAQ_PMS_UNWANTED_QUESTION' => 'HELP_FAQ_PMS_UNWANTED_ANSWER', + 'HELP_FAQ_PMS_SPAM_QUESTION' => 'HELP_FAQ_PMS_SPAM_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_FAQ_BLOCK_FRIENDS', + false, + array( + 'HELP_FAQ_FRIENDS_BASIC_QUESTION' => 'HELP_FAQ_FRIENDS_BASIC_ANSWER', + 'HELP_FAQ_FRIENDS_MANAGE_QUESTION' => 'HELP_FAQ_FRIENDS_MANAGE_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_FAQ_BLOCK_SEARCH', + false, + array( + 'HELP_FAQ_SEARCH_FORUM_QUESTION' => 'HELP_FAQ_SEARCH_FORUM_ANSWER', + 'HELP_FAQ_SEARCH_NO_RESULT_QUESTION' => 'HELP_FAQ_SEARCH_NO_RESULT_ANSWER', + 'HELP_FAQ_SEARCH_BLANK_QUESTION' => 'HELP_FAQ_SEARCH_BLANK_ANSWER', + 'HELP_FAQ_SEARCH_MEMBERS_QUESTION' => 'HELP_FAQ_SEARCH_MEMBERS_ANSWER', + 'HELP_FAQ_SEARCH_OWN_QUESTION' => 'HELP_FAQ_SEARCH_OWN_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_FAQ_BLOCK_BOOKMARKS', + false, + array( + 'HELP_FAQ_BOOKMARKS_DIFFERENCE_QUESTION' => 'HELP_FAQ_BOOKMARKS_DIFFERENCE_ANSWER', + 'HELP_FAQ_BOOKMARKS_TOPIC_QUESTION' => 'HELP_FAQ_BOOKMARKS_TOPIC_ANSWER', + 'HELP_FAQ_BOOKMARKS_FORUM_QUESTION' => 'HELP_FAQ_BOOKMARKS_FORUM_ANSWER', + 'HELP_FAQ_BOOKMARKS_REMOVE_QUESTION' => 'HELP_FAQ_BOOKMARKS_REMOVE_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_FAQ_BLOCK_ATTACHMENTS', + false, + array( + 'HELP_FAQ_ATTACHMENTS_ALLOWED_QUESTION' => 'HELP_FAQ_ATTACHMENTS_ALLOWED_ANSWER', + 'HELP_FAQ_ATTACHMENTS_OWN_QUESTION' => 'HELP_FAQ_ATTACHMENTS_OWN_ANSWER', + ) + ); + $this->manager->add_block( + 'HELP_FAQ_BLOCK_ISSUES', + false, + array( + 'HELP_FAQ_ISSUES_WHOIS_PHPBB_QUESTION' => 'HELP_FAQ_ISSUES_WHOIS_PHPBB_ANSWER', + 'HELP_FAQ_ISSUES_FEATURE_QUESTION' => 'HELP_FAQ_ISSUES_FEATURE_ANSWER', + 'HELP_FAQ_ISSUES_LEGAL_QUESTION' => 'HELP_FAQ_ISSUES_LEGAL_ANSWER', + 'HELP_FAQ_ISSUES_ADMIN_QUESTION' => 'HELP_FAQ_ISSUES_ADMIN_ANSWER', + ) + ); + + return $this->language->lang('FAQ_EXPLAIN'); + } +} diff --git a/phpBB/posting.php b/phpBB/posting.php index 2d01922c80..fd09f5e464 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1743,7 +1743,7 @@ $page_data = array( 'USERNAME' => ((!$preview && $mode != 'quote') || $preview) ? $post_data['username'] : '', 'SUBJECT' => $post_data['post_subject'], 'MESSAGE' => $post_data['post_text'], - 'BBCODE_STATUS' => $user->lang(($bbcode_status ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '', ''), + 'BBCODE_STATUS' => $user->lang(($bbcode_status ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '', ''), 'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'], 'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], 'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 7bd9d07033..2f58646722 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -376,7 +376,7 @@ while ($row = $db->sql_fetchrow($result)) $row['session_page'] === 'app.' . $phpEx . '/help/bbcode') { $location = $user->lang['VIEWING_FAQ']; - $location_url = $controller_helper->route('phpbb_help_controller', array('mode' => 'faq')); + $location_url = $controller_helper->route('phpbb_help_faq_controller'); } break; } From f6c246f8899edb480c7347cb43e2cbdc96c80d17 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 16 May 2015 23:08:42 +0200 Subject: [PATCH 5/9] [ticket/13844] Add a functional test that browses the help pages PHPBB3-13844 --- tests/functional/browse_test.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/functional/browse_test.php b/tests/functional/browse_test.php index b9e74a280f..4f28879687 100644 --- a/tests/functional/browse_test.php +++ b/tests/functional/browse_test.php @@ -34,6 +34,18 @@ class phpbb_functional_browse_test extends phpbb_functional_test_case $this->assertGreaterThan(0, $crawler->filter('.postbody')->count()); } + public function test_help_faq() + { + $crawler = self::request('GET', 'app.php/help/faq'); + $this->assertGreaterThan(0, $crawler->filter('h2.faq-title')->count()); + } + + public function test_help_bbcode() + { + $crawler = self::request('GET', 'app.php/help/bbcode'); + $this->assertGreaterThan(0, $crawler->filter('h2.faq-title')->count()); + } + public function test_feed() { $crawler = self::request('GET', 'feed.php', array(), false); From 80be642a0b77d400dadce7a8a30c50d32c27bf1f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 16 May 2015 23:13:50 +0200 Subject: [PATCH 6/9] [ticket/13844] Fix language file so the tests pass PHPBB3-13844 --- phpBB/develop/lang_migrate_help_lang.php | 4 ++-- phpBB/language/en/help/bbcode.php | 4 ++-- phpBB/language/en/help/faq.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/phpBB/develop/lang_migrate_help_lang.php b/phpBB/develop/lang_migrate_help_lang.php index d523493c83..d5a2573ee0 100644 --- a/phpBB/develop/lang_migrate_help_lang.php +++ b/phpBB/develop/lang_migrate_help_lang.php @@ -252,7 +252,7 @@ function write_help($help, array $lang) global $phpbb_root_path; $fp = fopen($phpbb_root_path . 'language/en/help/' . $help . '.php', 'wb'); fwrite($fp, get_language_file_header()); - fwrite($fp, '$lang = array(' . "\n"); + fwrite($fp, '$lang = array_merge($lang, array(' . "\n"); $last_key = ''; ksort($lang); @@ -270,7 +270,7 @@ function write_help($help, array $lang) $last_key = $key_start; } - fwrite($fp, ');' . "\n"); + fwrite($fp, '));' . "\n"); #fwrite($fp, $lang); fclose($fp); } diff --git a/phpBB/language/en/help/bbcode.php b/phpBB/language/en/help/bbcode.php index cfbba0b771..d3b36d8015 100644 --- a/phpBB/language/en/help/bbcode.php +++ b/phpBB/language/en/help/bbcode.php @@ -24,7 +24,7 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -$lang = array( +$lang = array_merge($lang, array( 'HELP_BBCODE_BLOCK_IMAGES' => 'Showing images in posts', 'HELP_BBCODE_BLOCK_INTRO' => 'Introduction', 'HELP_BBCODE_BLOCK_LINKS' => 'Creating Links', @@ -63,4 +63,4 @@ $lang = array( 'HELP_BBCODE_TEXT_COLOR_QUESTION' => 'How to change the text colour or size', 'HELP_BBCODE_TEXT_COMBINE_ANSWER' => 'Yes, of course you can, for example to get someones attention you may write:

[size=200][color=red][b]LOOK AT ME![/b][/color][/size]

this would output LOOK AT ME!

We don’t recommend you output lots of text that looks like this though! Remember it is up to you, the poster, to ensure tags are closed correctly. For example the following is incorrect:

[b][u]This is wrong[/b][/u]', 'HELP_BBCODE_TEXT_COMBINE_QUESTION' => 'Can I combine formatting tags?', -); +)); diff --git a/phpBB/language/en/help/faq.php b/phpBB/language/en/help/faq.php index fdb6f62aee..e59d950948 100644 --- a/phpBB/language/en/help/faq.php +++ b/phpBB/language/en/help/faq.php @@ -24,7 +24,7 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -$lang = array( +$lang = array_merge($lang, array( 'HELP_FAQ_ATTACHMENTS_ALLOWED_ANSWER' => 'Each board administrator can allow or disallow certain attachment types. If you are unsure what is allowed to be uploaded, contact the board administrator for assistance.', 'HELP_FAQ_ATTACHMENTS_ALLOWED_QUESTION' => 'What attachments are allowed on this board?', 'HELP_FAQ_ATTACHMENTS_OWN_ANSWER' => 'To find your list of attachments that you have uploaded, go to your User Control Panel and follow the links to the attachments section.', @@ -183,4 +183,4 @@ $lang = array( 'HELP_FAQ_USERSETTINGS_SERVERTIME_QUESTION' => 'I changed the timezone and the time is still wrong!', 'HELP_FAQ_USERSETTINGS_TIMEZONE_ANSWER' => 'It is possible the time displayed is from a timezone different from the one you are in. If this is the case, visit your User Control Panel and change your timezone to match your particular area, e.g. London, Paris, New York, Sydney, etc. Please note that changing the timezone, like most settings, can only be done by registered users. If you are not registered, this is a good time to do so.', 'HELP_FAQ_USERSETTINGS_TIMEZONE_QUESTION' => 'The times are not correct!', -); +)); From 8ce0a64a16aa9d1b8edcef684c528cf44bc39cc6 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 17 May 2015 21:18:17 +0200 Subject: [PATCH 7/9] [ticket/13844] Remove hacky code for the help array PHPBB3-13844 --- phpBB/phpbb/language/language.php | 7 +------ phpBB/phpbb/language/language_file_loader.php | 12 +++--------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/phpBB/phpbb/language/language.php b/phpBB/phpbb/language/language.php index 3298908365..b2b9f5ce12 100644 --- a/phpBB/phpbb/language/language.php +++ b/phpBB/phpbb/language/language.php @@ -83,10 +83,7 @@ class language // Set up default information $this->user_language = false; $this->default_language = false; - $this->lang = array( - // For BC with user::help array - '__help' => array(), - ); + $this->lang = array(); $this->loaded_language_sets = array( 'core' => array(), 'ext' => array(), @@ -155,8 +152,6 @@ class language /** * Add Language Items * - * Note: $use_help is assigned where needed (only use them to force inclusion). - * * Examples: * * $component = array('posting'); diff --git a/phpBB/phpbb/language/language_file_loader.php b/phpBB/phpbb/language/language_file_loader.php index 510a29279a..9862cfc3aa 100644 --- a/phpBB/phpbb/language/language_file_loader.php +++ b/phpBB/phpbb/language/language_file_loader.php @@ -154,10 +154,12 @@ class language_file_loader * * @return string Relative path to language file * - * @throws \phpbb\language\exception\language_file_not_exists When the path to the file cannot be resolved + * @throws \phpbb\language\exception\language_file_not_found When the path to the file cannot be resolved */ protected function get_language_file_path($path, $filename, $locales) { + $language_file_path = $filename; + // Language fallback logic foreach ($locales as $locale) { @@ -191,9 +193,6 @@ class language_file_loader */ protected function load_language_file($path, &$lang) { - // BC code for language files with help - $help = array(); - // Do not suppress error if in DEBUG mode if (defined('DEBUG')) { @@ -203,10 +202,5 @@ class language_file_loader { @include $path; } - - if (!empty($help)) - { - $lang['__help'] = array_merge($lang['__help'], $help); - } } } From 6dcc14bc5824b3ff74a3cd3acd574ae5e530d1c3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 17 May 2015 21:45:18 +0200 Subject: [PATCH 8/9] [ticket/13844] Add unit tests for the help manager PHPBB3-13844 --- tests/help/manager_test.php | 183 ++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 tests/help/manager_test.php diff --git a/tests/help/manager_test.php b/tests/help/manager_test.php new file mode 100644 index 0000000000..aaf63194fa --- /dev/null +++ b/tests/help/manager_test.php @@ -0,0 +1,183 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +class phpbb_language_test extends phpbb_test_case +{ + /** @var \phpbb\help\manager */ + protected $manager; + /** @var \phpbb\template\template */ + protected $template; + /** @var \phpbb\language\language */ + protected $language; + + public function setUp() + { + $this->template = $this->getMockBuilder('\phpbb\template\template') + ->disableOriginalConstructor() + ->getMock(); + $this->language = $this->getMockBuilder('\phpbb\language\language') + ->disableOriginalConstructor() + ->getMock(); + + $this->manager = new \phpbb\help\manager( + $this->template, + $this->language + ); + } + + public function add_block_data() + { + return array( + array('abc', false, array(), false), + array('def', true, array(), true), + array( + 'abc', + false, + array( + 'question1' => 'answer1', + 'question2' => 'answer2', + 'question3' => 'answer3', + ), + false + ), + ); + } + + /** + * @dataProvider add_block_data + * + * @param string $block_name + * @param bool $switch + * @param array $questions + * @param bool $switch_expected + */ + public function test_add_block($block_name, $switch, $questions, $switch_expected) + { + $this->language->expects($this->at(0)) + ->method('lang') + ->with($block_name) + ->willReturn(strtoupper($block_name)); + $lang_call_count = 1; + foreach ($questions as $question => $answer) + { + $this->language->expects($this->at($lang_call_count)) + ->method('lang') + ->with($question) + ->willReturn(strtoupper($question)); + $lang_call_count++; + + $this->language->expects($this->at($lang_call_count)) + ->method('lang') + ->with($answer) + ->willReturn(strtoupper($answer)); + $lang_call_count++; + } + + $this->template->expects($this->at(0)) + ->method('assign_block_vars') + ->with('faq_block', array( + 'BLOCK_TITLE' => strtoupper($block_name), + 'SWITCH_COLUMN' => $switch_expected, + )); + $template_call_count = 1; + foreach ($questions as $question => $answer) + { + $this->template->expects($this->at($template_call_count)) + ->method('assign_block_vars') + ->with('faq_block.faq_row', array( + 'FAQ_QUESTION' => strtoupper($question), + 'FAQ_ANSWER' => strtoupper($answer), + )); + $template_call_count++; + } + + $this->manager->add_block($block_name, $switch, $questions); + + $this->assertEquals($switch_expected, $this->manager->switched_column()); + } + + public function add_question_data() + { + return array( + array('abc', false, false), + array('def', true, true), + ); + } + + /** + * @dataProvider add_question_data + * + * @param string $question + * @param string $answer + */ + public function test_add_question($question, $answer) + { + $this->language->expects($this->at(0)) + ->method('lang') + ->with($question) + ->willReturn(strtoupper($question)); + $this->language->expects($this->at(1)) + ->method('lang') + ->with($answer) + ->willReturn(strtoupper($answer)); + + $this->template->expects($this->once()) + ->method('assign_block_vars') + ->with('faq_block.faq_row', array( + 'FAQ_QUESTION' => strtoupper($question), + 'FAQ_ANSWER' => strtoupper($answer), + )); + + $this->manager->add_question($question, $answer); + } + + public function test_add_block_double_switch() + { + $block_name = 'abc'; + $switch_expected = true; + + $this->language->expects($this->at(0)) + ->method('lang') + ->with($block_name) + ->willReturn(strtoupper($block_name)); + + $this->template->expects($this->at(0)) + ->method('assign_block_vars') + ->with('faq_block', array( + 'BLOCK_TITLE' => strtoupper($block_name), + 'SWITCH_COLUMN' => $switch_expected, + )); + + $this->manager->add_block($block_name, true); + $this->assertTrue($this->manager->switched_column()); + + // Add a second block with switch + $block_name = 'def'; + $switch_expected = false; + + $this->language->expects($this->at(0)) + ->method('lang') + ->with($block_name) + ->willReturn(strtoupper($block_name)); + + $this->template->expects($this->at(0)) + ->method('assign_block_vars') + ->with('faq_block', array( + 'BLOCK_TITLE' => strtoupper($block_name), + 'SWITCH_COLUMN' => $switch_expected, + )); + + $this->manager->add_block($block_name, true); + $this->assertTrue($this->manager->switched_column()); + } +} From 077051fef56f0d9b504a2593dc84a3d05ef02e18 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 20 May 2015 00:23:42 +0200 Subject: [PATCH 9/9] [ticket/13844] Add events PHPBB3-13844 --- .../default/container/services_help.yml | 5 +- phpBB/phpbb/help/controller/controller.php | 7 +-- phpBB/phpbb/help/manager.php | 61 +++++++++++++++++-- tests/help/manager_test.php | 7 ++- 4 files changed, 63 insertions(+), 17 deletions(-) diff --git a/phpBB/config/default/container/services_help.yml b/phpBB/config/default/container/services_help.yml index 29523ffb27..8b9d497945 100644 --- a/phpBB/config/default/container/services_help.yml +++ b/phpBB/config/default/container/services_help.yml @@ -2,14 +2,14 @@ services: phpbb.help.manager: class: phpbb\help\manager arguments: - - @template + - @dispatcher - @language + - @template phpbb.help.controller.bbcode: class: phpbb\help\controller\bbcode arguments: - @controller.helper - - @dispatcher - @phpbb.help.manager - @template - @language @@ -20,7 +20,6 @@ services: class: phpbb\help\controller\faq arguments: - @controller.helper - - @dispatcher - @phpbb.help.manager - @template - @language diff --git a/phpBB/phpbb/help/controller/controller.php b/phpBB/phpbb/help/controller/controller.php index 743a9c7fde..29494205a9 100644 --- a/phpBB/phpbb/help/controller/controller.php +++ b/phpBB/phpbb/help/controller/controller.php @@ -21,9 +21,6 @@ abstract class controller /** @var \phpbb\controller\helper */ protected $helper; - /** @var \phpbb\event\dispatcher_interface */ - protected $dispatcher; - /** @var \phpbb\help\manager */ protected $manager; @@ -43,17 +40,15 @@ abstract class controller * Constructor * * @param \phpbb\controller\helper $helper - * @param \phpbb\event\dispatcher_interface $dispatcher * @param \phpbb\help\manager $manager * @param \phpbb\template\template $template * @param \phpbb\language\language $language * @param string $root_path * @param string $php_ext */ - public function __construct(\phpbb\controller\helper $helper, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\help\manager $manager, \phpbb\template\template $template, \phpbb\language\language $language, $root_path, $php_ext) + public function __construct(\phpbb\controller\helper $helper, \phpbb\help\manager $manager, \phpbb\template\template $template, \phpbb\language\language $language, $root_path, $php_ext) { $this->helper = $helper; - $this->dispatcher = $dispatcher; $this->manager = $manager; $this->template = $template; $this->language = $language; diff --git a/phpBB/phpbb/help/manager.php b/phpBB/phpbb/help/manager.php index a7320563a8..d6991c0733 100644 --- a/phpBB/phpbb/help/manager.php +++ b/phpBB/phpbb/help/manager.php @@ -18,25 +18,30 @@ namespace phpbb\help; */ class manager { - /** @var \phpbb\template\template */ - protected $template; + /** @var \phpbb\event\dispatcher */ + protected $dispatcher; /** @var \phpbb\language\language */ protected $language; + /** @var \phpbb\template\template */ + protected $template; + /** @var bool */ protected $switched_column; /** * Constructor * - * @param \phpbb\template\template $template + * @param \phpbb\event\dispatcher $dispatcher * @param \phpbb\language\language $language + * @param \phpbb\template\template $template */ - public function __construct(\phpbb\template\template $template, \phpbb\language\language $language) + public function __construct(\phpbb\event\dispatcher $dispatcher, \phpbb\language\language $language, \phpbb\template\template $template) { - $this->template = $template; + $this->dispatcher = $dispatcher; $this->language = $language; + $this->template = $template; } /** @@ -47,6 +52,18 @@ class manager */ public function add_block($block_name, $switch_column = false, $questions = array()) { + /** + * You can use this event to add a block before the current one. + * + * @event core.help_manager_add_block_before + * @var string block_name Language key of the block headline + * @var bool switch_column Should we switch the menu column before this headline + * @var array questions Array with questions + * @since 3.2.0-a1 + */ + $vars = array('block_name', 'switch_column', 'questions'); + extract($this->dispatcher->trigger_event('core.help_manager_add_block_before', compact($vars))); + $this->template->assign_block_vars('faq_block', array( 'BLOCK_TITLE' => $this->language->lang($block_name), 'SWITCH_COLUMN' => !$this->switched_column && $switch_column, @@ -58,6 +75,18 @@ class manager } $this->switched_column = $this->switched_column || $switch_column; + + /** + * You can use this event to add a block after the current one. + * + * @event core.help_manager_add_block_after + * @var string block_name Language key of the block headline + * @var bool switch_column Should we switch the menu column before this headline + * @var array questions Array with questions + * @since 3.2.0-a1 + */ + $vars = array('block_name', 'switch_column', 'questions'); + extract($this->dispatcher->trigger_event('core.help_manager_add_block_after', compact($vars))); } /** @@ -68,10 +97,32 @@ class manager */ public function add_question($question, $answer) { + /** + * You can use this event to add a question before the current one. + * + * @event core.help_manager_add_question_before + * @var string question Language key of the question + * @var string answer Language key of the answer + * @since 3.2.0-a1 + */ + $vars = array('question', 'answer'); + extract($this->dispatcher->trigger_event('core.help_manager_add_question_before', compact($vars))); + $this->template->assign_block_vars('faq_block.faq_row', array( 'FAQ_QUESTION' => $this->language->lang($question), 'FAQ_ANSWER' => $this->language->lang($answer), )); + + /** + * You can use this event to add a question after the current one. + * + * @event core.help_manager_add_question_after + * @var string question Language key of the question + * @var string answer Language key of the answer + * @since 3.2.0-a1 + */ + $vars = array('question', 'answer'); + extract($this->dispatcher->trigger_event('core.help_manager_add_question_after', compact($vars))); } /** diff --git a/tests/help/manager_test.php b/tests/help/manager_test.php index aaf63194fa..68534d9a32 100644 --- a/tests/help/manager_test.php +++ b/tests/help/manager_test.php @@ -11,7 +11,7 @@ * */ -class phpbb_language_test extends phpbb_test_case +class phpbb_help_manager_test extends phpbb_test_case { /** @var \phpbb\help\manager */ protected $manager; @@ -30,8 +30,9 @@ class phpbb_language_test extends phpbb_test_case ->getMock(); $this->manager = new \phpbb\help\manager( - $this->template, - $this->language + new \phpbb_mock_event_dispatcher(), + $this->language, + $this->template ); }